-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 build fails when hibernate-orm extension used with quarkus.native.auto-service-loader-registration=true #45580
Comments
The method is reachable through the following Object graph:
Looking into My understanding is that Using
works around the issue. FWIW the issue is not reproducible starting with GraalVM for JDK 24 (not released yet). cc @yrodiere |
Could you please tell me how did you get reachability graph? |
Sure. Unfortunately it's not trivial though, it requires debugging GraalVM.
HTH |
AFAIK It seems strange that we need to, considering there shouldn't be any code that reaches this class at runtime and I'd expect GraalVM to see that, but we've seen stranger things in the past. |
@yrodiere sadly, I'm not sure that is the case: https://github.com/hibernate/hibernate-orm/blob/f0f96916adb5adbba56ed19f583343559d16576b/hibernate-core/src/main/java/org/hibernate/proxy/pojo/bytebuddy/ByteBuddyProxyFactory.java#L56 This is called during mapping metamodel initialization, which currently is happening at runtime (on |
We override that bit in Quarkus, see usages of Line 17 in 750860e
And see in particular how we just fail if a proxy wasn't generated ahead of time: Lines 58 to 62 in db20a5e
|
@yrodiere It looks like |
The service implementation that should be used in Quarkus at runtime is So I'd suggest:
|
Describe the bug
Native build of quarkus application with hibernate-orm extension fails when quarkus.native.auto-service-loader-registration=true.
Error:
Error: java.util.concurrent.ExecutionException: org.graalvm.compiler.debug.GraalError: com.oracle.svm.hosted.substitute.DeletedElementException: Unsupported method java.lang.Object.wait0(long ) is reachable
Expected behavior
Build should succeed.
Actual behavior
Build fails with exception.
How to Reproduce?
Маке new quarkus project:
mvn io.quarkus.platform:quarkus-maven-plugin:3.17.6:create -DprojectGroupId=org.acme -DprojectArtifactId=getting-started -DjavaVersion=21
Add hibernate-orm and postgresql dependencies to pom.xml:
Add entity class to force hibernate extension to work:
Edit application.properties, add following line:
quarkus.native.auto-service-loader-registration=true
Do native build:
mvnw clean install -Dnative -DskipTests -Dquarkus.native.container-build=true
It fails with error:
Output of
uname -a
orver
No response
Output of
java -version
Mandrel or GraalVM version (if different from Java)
No response
Quarkus version or git rev
No response
Build tool (ie. output of
mvnw --version
orgradlew --version
)Additional information
No response
The text was updated successfully, but these errors were encountered: