-
Notifications
You must be signed in to change notification settings - Fork 92
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
New org.hibernate.orm Hibernate Core 6.2.0.Final Hints Break Native Image #273
Comments
App does build when reverting to prior hints: <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> |
In Hibernate Core |
There native plugin uses the latest version available by default. Spring Boot's latest version uses 6.1.7.Final, but since only 6.1.1.Final is available, it will grab the latest available version. So now, a Spring Boot 3 app will fail to launch with the default configuration. |
Perhaps an enhancement could be made - so that it won't use the hints for a higher minor version. |
I think we are impacted by the issue I was describing in #62. We will discuss how to handle that and find a proper fix. |
I believe the work done in #274 was not enough as seems the following classes from Hibernate core are still not reachable.
Those are used by Spring Boot Hibernate JPA auto-configuration: Running a native Spring Boot application using metadata private Object getNoJtaPlatformManager() {
for (String candidate : NO_JTA_PLATFORM_CLASSES) {
try {
return Class.forName(candidate).getDeclaredConstructor().newInstance();
}
catch (Exception ex) {
// Continue searching
}
}
throw new IllegalStateException(
"No available JtaPlatform candidates amongst " + Arrays.toString(NO_JTA_PLATFORM_CLASSES));
} |
I don't believe the work done in the PR you linked was meant to fix this. Sébastien from the Spring team is working on a fix: #62 |
@matthenry87 My bad, I now realized what's happening in your case (if I got it right, your metadata is resolved from Probably different case although latest one provided by Spring Boot (3.1.0-RC2) is now |
I confirm the issue with Spring Boot 3.1.0-RC2, but looks like a different one where some metadata are missing from Hibernate 6.2 hints. |
@ArnauAregall Can you please create a dedicated issue for the Hibernate 6.2 breakage with Boot 3.1? |
@ArnauAregall Wait, looks like the issue may be on Spring Boot side, I will report that to them. |
Thanks a lot @sdeleuze! Let me know if I can help or support you somehow, even with a sample app showcasing the issue. |
Hello lovely people, is there a suggested approach for Boot 3.1 final that just came out a few hour ago ? |
It's hard to say for certain as "all of them break" doesn't give us much to go on, but you may be hitting spring-projects/spring-framework#30492. You could try Framework 6.0.10-SNAPSHOT that's available from https://repo.spring.io/snapshot. |
@wilkinsona the error without postive the entire trace: "Caused by: com.oracle.svm.core.jdk.UnsupportedFeatureError: No classes have been predefined during the image build to load from bytecodes at runtime." So it could be related to the bytebuddy issue mentioned in your link. So if the fix is in framework 6.0.10, i guess the fix will be available in boot 3.1.1 ? @goafabric: remindme |
Yes, that's the plan. |
Describe the bug
My Spring Boot 3 native image apps no longer launch. Hints that are present in the previous org.hibernate.orm Hibernate Core version are missing from the new one.
To Reproduce
Steps to reproduce the behavior:
Attempt to launch a Spring Boot 3 native image app that uses Hibernate Core 6.2.0.Final
Expected behavior
App launches like prior to release of new hints.
Logs
System Info (please complete the following information):
Kubernetes 1.25, containerd, debian-based builder pod
17
latest Spring Boot managed version in 3.0.6
Additional context
So far had to add:
and now:
The text was updated successfully, but these errors were encountered: