Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native Image: fix startup error #26

Open
alvessteve opened this issue Apr 20, 2023 · 6 comments
Open

Native Image: fix startup error #26

alvessteve opened this issue Apr 20, 2023 · 6 comments

Comments

@alvessteve
Copy link
Owner

Error:

java.lang.illegalstateexception: no available jtaplatform candidates amongst [org.hibernate.engine.transaction.jta.platform.internal.nojtaplatform, org.hibernate.service.jta.platform.internal.nojtaplatform]

@alvessteve
Copy link
Owner Author

seems related to this: spring-projects/spring-boot#32659

@matthenry87
Copy link

matthenry87 commented Apr 20, 2023

Running into this after upgrading to Spring Boot 3.0.6 today, on a previously working native image app.

Will try to get a reproducer project together soon.

Edit: Just realized this isn't a Spring repo LOL.

@matthenry87
Copy link

There was a set of new hints added to the GraalVM reachibility metadata repository for Hibernate Core. This new set of hints appears to be missing hints that the previous version's set had.

So far I've had to add these hints (currently adding via code):

            hints.reflection()
                    .registerType(NoJtaPlatform.class, INTROSPECT_PUBLIC_METHODS)
                    .registerConstructor(NoJtaPlatform.class.getConstructor(), INVOKE)

                    .registerConstructor(SpringImplicitNamingStrategy.class.getConstructor(), INVOKE)
                    .registerConstructor(CamelCaseToUnderscoresNamingStrategy.class.getConstructor(), INVOKE);

@matthenry87
Copy link

<plugin>
    <groupId>org.graalvm.buildtools</groupId>
    <artifactId>native-maven-plugin</artifactId>
    <configuration>
        <metadataRepository>
            <dependencies>
                <dependency>
                    <groupId>org.hibernate.orm</groupId>
                    <artifactId>hibernate-core</artifactId>
                    <metadataVersion>6.1.1.Final</metadataVersion>
                </dependency>
            </dependencies>
        </metadataRepository>
    </configuration>
</plugin>

This fixed it for me. (I'm using Maven, not Gradle)

@alvessteve
Copy link
Owner Author

Thank you very much for the hints ! will try these

@ArnauAregall
Copy link

ArnauAregall commented Apr 23, 2023

I also started experiencing the same issue in one of my repositories after upgrading GraalVM Build tools native plugin (org.graalvm.buildtools.native) from 0.9.20 to 0.9.21.

ArnauAregall/kotlin-spring-data-rest-movies@e198340

Downgrading again to 0.9.20 worked fine again (using Gradle).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants