-
Notifications
You must be signed in to change notification settings - Fork 40.9k
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 Application w/ Hibernate Breaks w/ Latest Reachability Metadata #35103
Comments
With Gradle, we could configure this like so:
I'm not sure how easy it would be to provide similar configuration for Maven. We may be able to do something in The mapping is really a workaround either for broken metadata or for the behavior of the native build tools plugins. It would be better to address the problem in one of those locations. If we add a workaround it's hard to know when to remove it and keeping it around for too long may do more harm than good. We'd need to consider the version of the NBT plugin that's in use. We'd also have to consider the version of the "official" reachability metadata that's being used and account for the fact that custom metadata is also supported. I'll flag this one for team discussion. In the meantime, @matthenry87, can you please open an NBT issue as I think the reachability metadata repository support should match versions more intelligently. |
Created graalvm/native-build-tools#430. |
Duplicating here the 2 workarounds for Maven (already posted in the closed issue linked just above):
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>0.9.20</version>
</plugin>
<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> |
For anyone interested in the workarounds, downgrading the native build plugin helps because it also downgrades the version of the reachability metadata that's used by default. A more focussed workaround would be to just configure the metadata version instead. 0.2.7 contains the metadata for Hibernate 6.2 which breaks Hibernate 6.1.x. Downgrading to 0.2.6 should solve the problem: <metadataRepository>
<enabled>true</enabled>
<version>0.2.6</version>
</metadataRepository> graalvmNative {
metadataRepository {
version = "0.2.6"
}
} |
FYI I start working on oracle/graalvm-reachability-metadata#62 with related NBT changes in order to fix this issue and prevent similar one to appear, with the goal to get it included in Spring Boot 3.0.7 if that's ok for the Spring team. |
Given the various workarounds that are available and the work being done to address this in NBT and the reachability metadata, I'm going to close this one now as I don't think baking a workaround into Spring Boot will serve us particularly well at this point. |
For context if you land here looking for help, workarounds are still needed even with latest versions.
|
Spring Boot is using Hibernate Core 6.1.7.Final. Hints are only available for 6.1.1 and now 6.2.x. The Native plugin chooses the latest version by default if it can't find the version it's using, which now breaks the image, and it fails to start.
The managed configuration for the plugin should be updated to point to 6.1.1 hints so that Spring apps work without additional configuration.
I'll try to get a reproducer app together shortly, but this one is pretty straight forward.
The text was updated successfully, but these errors were encountered: