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 build fails when hibernate-orm extension used with quarkus.native.auto-service-loader-registration=true #45580

Open
ylepikhov opened this issue Jan 14, 2025 · 9 comments
Labels
area/hibernate-orm Hibernate ORM area/native-image kind/bug Something isn't working

Comments

@ylepikhov
Copy link

ylepikhov commented Jan 14, 2025

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:

       <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-hibernate-orm</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-jdbc-postgresql</artifactId>
        </dependency>

Add entity class to force hibernate extension to work:

@Entity
class TestEntity {

    @Id
    public int id;
}

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:

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                                                                                                                                                                                 
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.               
com.oracle.graal.pointsto.util.AnalysisError: java.util.concurrent.ExecutionException: org.graalvm.compiler.debug.GraalError: com.oracle.svm.hosted.substitute.DeletedElementException: Unsuppo
rted method java.lang.Object.wait0(long) is reachable                                                                                                                                          
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.               
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.AnalysisError.shouldNotReachHere(AnalysisError.java:169)                                                            
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.AnalysisFuture.ensureDone(AnalysisFuture.java:66)                                                                   
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapObjectArray.readElementValue(ImageHeapObjectArray.java:84)                                                 
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapScanner.onObjectReachable(ImageHeapScanner.java:464)                                                       
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.heap.SVMImageHeapScanner.onObjectReachable(SVMImageHeapScanner.java:156)                                                      
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapScanner.lambda$markReachable$5(ImageHeapScanner.java:452)                                                  
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapScanner.lambda$postTask$14(ImageHeapScanner.java:695)                                                      
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:187)                                                      
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:171)                                             
        at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1423)                                                                                      
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)                                                                                                           
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)                                                                                          
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)                                                                                                            
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)                                                                                                       
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)                                                                                              
Caused by: java.util.concurrent.ExecutionException: org.graalvm.compiler.debug.GraalError: com.oracle.svm.hosted.substitute.DeletedElementException: Unsupported method java.lang.Object.wait0(
long) is reachable                                                                                                                                                                             
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.               
        at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)                                                                                                               
        at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)                                                                                                                  
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.AnalysisFuture.ensureDone(AnalysisFuture.java:64)                                                                   
        ... 13 more                                                                                                                                                                            
Caused by: org.graalvm.compiler.debug.GraalError: com.oracle.svm.hosted.substitute.DeletedElementException: Unsupported method java.lang.Object.wait0(long) is reachable                       
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.               
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.AnalysisFuture.setException(AnalysisFuture.java:49)                                                                 
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:322)                                                                                                                  
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.AnalysisFuture.ensureDone(AnalysisFuture.java:63)                                                                   
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapScanner.getOrCreateImageHeapConstant(ImageHeapScanner.java:212)                                            
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.heap.SVMImageHeapScanner.getOrCreateImageHeapConstant(SVMImageHeapScanner.java:109)                                           
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapScanner.createImageHeapConstant(ImageHeapScanner.java:186)                                                 
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapScanner.onArrayElementReachable(ImageHeapScanner.java:400)                                                 
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapScanner.lambda$patchArrayElement$10(ImageHeapScanner.java:593)                                             
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)                                                                                                                  
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.AnalysisFuture.ensureDone(AnalysisFuture.java:63)                                                                   
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.HeapSnapshotVerifier$ScanningObserver.forNonNullArrayElement(HeapSnapshotVerifier.java:228)                         
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.ObjectScanner.scanArrayElement(ObjectScanner.java:232)                                                                   
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.ObjectScanner.scanArray(ObjectScanner.java:220)                                                                          
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.ObjectScanner.doScan(ObjectScanner.java:391)                                                                             
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.ObjectScanner.lambda$scanConstant$6(ObjectScanner.java:257)                                                              
        ... 8 more                                                                                                                                                                             
Caused by: com.oracle.svm.hosted.substitute.DeletedElementException: Unsupported method java.lang.Object.wait0(long) is reachable                                                              
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.               
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.lookup(AnnotationSubstitutionProcessor.java:268)                                   
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.infrastructure.SubstitutionProcessor$ChainedSubstitutionProcessor.lookup(SubstitutionProcessor.java:140)                 
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisUniverse.lookupAllowUnresolved(AnalysisUniverse.java:438)                                                   
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisUniverse.lookup(AnalysisUniverse.java:417)                                                                  
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisUniverse.lookup(AnalysisUniverse.java:78)                                                                   
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.infrastructure.UniverseMetaAccess.lookupJavaMethod(UniverseMetaAccess.java:112)                                          
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMetaAccess.lookupJavaMethod(AnalysisMetaAccess.java:83)                                                     
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.reflect.ReflectionFeature.createAccessor(ReflectionFeature.java:187)                                                          
        at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)                                                                                       
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.reflect.ReflectionFeature.getOrCreateAccessor(ReflectionFeature.java:141)                                                     
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.reflect.target.ExecutableAccessorComputer.transform(ExecutableAccessorComputer.java:43)                                         
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.substitute.ComputedValueField.computeValue(ComputedValueField.java:366)                                                       
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.substitute.ComputedValueField.readValue(ComputedValueField.java:336)                                                          
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.ameta.AnalysisConstantReflectionProvider.readHostedFieldValue(AnalysisConstantReflectionProvider.java:235)                    
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.heap.SVMImageHeapScanner.readHostedFieldValue(SVMImageHeapScanner.java:124)                                                   
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapScanner.createImageHeapInstance(ImageHeapScanner.java:287)                                                 
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapScanner.createImageHeapObject(ImageHeapScanner.java:254)                                                   
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapScanner.lambda$getOrCreateImageHeapConstant$2(ImageHeapScanner.java:205)                                   
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)                                                                                                                  
        ... 21 more                                                                                                                                                                            

Output of uname -a or ver

No response

Output of java -version

java -version
openjdk version "21.0.5" 2024-10-15 LTS
OpenJDK Runtime Environment (build 21.0.5+11-LTS)
OpenJDK 64-Bit Server VM (build 21.0.5+11-LTS, mixed mode, sharing)

Mandrel or GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

mvnw -version
Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
Default locale: en_US, platform encoding: UTF-8
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

Additional information

No response

@ylepikhov ylepikhov added area/native-image kind/bug Something isn't working labels Jan 14, 2025
@quarkus-bot quarkus-bot bot added area/hibernate-orm Hibernate ORM env/windows Impacts Windows machines labels Jan 14, 2025
Copy link

quarkus-bot bot commented Jan 14, 2025

/cc @Karm (native-image), @galderz (native-image), @gsmet (hibernate-orm), @zakkak (native-image)

@zakkak
Copy link
Contributor

zakkak commented Jan 15, 2025

The method is reachable through the following Object graph:

reason = {ObjectScanner$ArrayScan@310974} "java.lang.reflect.Method[]"
 arrayType = {PointsToAnalysisType@310967} "AnalysisType<Method[] -> HotSpotType<[Ljava/lang/reflect/Method;, resolved>, allocated: true, inHeap: true, reachable: true>"
 previous = {ObjectScanner$FieldScan@310970} "java.util.Arrays$ArrayList.a"
  previous = {ObjectScanner$FieldScan@310987} "net.bytebuddy.description.method.MethodList$ForLoadedMethods.methods"
   previous = {ObjectScanner$FieldScan@311061} "net.bytebuddy.description.type.TypeDescription$ForLoadedType.declaredMethods"
    previous = {ObjectScanner$EmbeddedRootScan@311067} "org.hibernate.proxy.pojo.bytebuddy.ByteBuddyProxyHelper.lambda$proxyBuilder$0(ByteBuddyProxyHelper.java:89)"
     previous = {ObjectScanner$MethodParsing@311073} "parsing method org.hibernate.proxy.pojo.bytebuddy.ByteBuddyProxyHelper.lambda$proxyBuilder$0(ByteBuddyProxyHelper.java:86) reachable via the parsing context\n
    at org.hibernate.proxy.pojo.bytebuddy.ByteBuddyProxyHelper$$Lambda/0x00000007c24dcef0.apply(Unknown Source)\n
    at io.vertx.core.Vertx_LWrsYRaP0Jv92xLS2Ep8aqzdJ1k_Synthetic_Bean.createSynthetic(Unknown Source)\n
    at io.vertx.core.Vertx_LWrsYRaP0Jv92xLS2Ep8aqzdJ1k_Synthetic_Bean.doCreate(Unknown Source)\n    at io.vertx.core.Vertx_LWrsYRaP0Jv92xLS2Ep8aqzdJ1k_Synthetic_Bean.create(Unknown Source)\n
    at io.vertx.core.Vertx_LWrsYRaP0Jv92xLS2Ep8aqzdJ1k_Synthetic_Bean.create(Unknown Source)\n
    at io.quarkus.arc.impl.RequestContext$1.get(RequestContext.java:79)\n
    at io.quarkus.arc.impl.RequestContext$1.get(RequestContext.java:75)\n
    at io.quarkus.vertx.http.runtime.VertxHttpRecorder.startServer(VertxHttpRecorder.java:360)\n
    at io.quarkus.deployment.steps.VertxHttpProcessor$openSocket1753087980.deploy_0(Unknown Source)\n
    at io"

Looking into org.hibernate.proxy.pojo.bytebuddy.ByteBuddyProxyHelper I see that the OBJECT field is the one responsible for making wait0 reachable.

My understanding is that quarkus.native.auto-service-loader-registration=true results in org.hibernate.proxy.pojo.bytebuddy.ByteBuddyProxyHelper being brought in.

Using

-Dquarkus.native.additional-build-args=-H:ServiceLoaderFeatureExcludeServices=org.hibernate.bytecode.spi.BytecodeProvider

works around the issue.

FWIW the issue is not reproducible starting with GraalVM for JDK 24 (not released yet).

cc @yrodiere

@zakkak zakkak removed the env/windows Impacts Windows machines label Jan 15, 2025
@ylepikhov
Copy link
Author

The method is reachable through the following Object graph:

reason = {ObjectScanner$ArrayScan@310974} "java.lang.reflect.Method[]"
 arrayType = {PointsToAnalysisType@310967} "AnalysisType<Method[] -> HotSpotType<[Ljava/lang/reflect/Method;, resolved>, allocated: true, inHeap: true, reachable: true>"
 previous = {ObjectScanner$FieldScan@310970} "java.util.Arrays$ArrayList.a"
  previous = {ObjectScanner$FieldScan@310987} "net.bytebuddy.description.method.MethodList$ForLoadedMethods.methods"
   previous = {ObjectScanner$FieldScan@311061} "net.bytebuddy.description.type.TypeDescription$ForLoadedType.declaredMethods"
    previous = {ObjectScanner$EmbeddedRootScan@311067} "org.hibernate.proxy.pojo.bytebuddy.ByteBuddyProxyHelper.lambda$proxyBuilder$0(ByteBuddyProxyHelper.java:89)"
     previous = {ObjectScanner$MethodParsing@311073} "parsing method org.hibernate.proxy.pojo.bytebuddy.ByteBuddyProxyHelper.lambda$proxyBuilder$0(ByteBuddyProxyHelper.java:86) reachable via the parsing context\n
    at org.hibernate.proxy.pojo.bytebuddy.ByteBuddyProxyHelper$$Lambda/0x00000007c24dcef0.apply(Unknown Source)\n
    at io.vertx.core.Vertx_LWrsYRaP0Jv92xLS2Ep8aqzdJ1k_Synthetic_Bean.createSynthetic(Unknown Source)\n
    at io.vertx.core.Vertx_LWrsYRaP0Jv92xLS2Ep8aqzdJ1k_Synthetic_Bean.doCreate(Unknown Source)\n    at io.vertx.core.Vertx_LWrsYRaP0Jv92xLS2Ep8aqzdJ1k_Synthetic_Bean.create(Unknown Source)\n
    at io.vertx.core.Vertx_LWrsYRaP0Jv92xLS2Ep8aqzdJ1k_Synthetic_Bean.create(Unknown Source)\n
    at io.quarkus.arc.impl.RequestContext$1.get(RequestContext.java:79)\n
    at io.quarkus.arc.impl.RequestContext$1.get(RequestContext.java:75)\n
    at io.quarkus.vertx.http.runtime.VertxHttpRecorder.startServer(VertxHttpRecorder.java:360)\n
    at io.quarkus.deployment.steps.VertxHttpProcessor$openSocket1753087980.deploy_0(Unknown Source)\n
    at io"

Looking into org.hibernate.proxy.pojo.bytebuddy.ByteBuddyProxyHelper I see that the OBJECT field is the one responsible for making wait0 reachable.

My understanding is that quarkus.native.auto-service-loader-registration=true results in org.hibernate.proxy.pojo.bytebuddy.ByteBuddyProxyHelper being brought in.

Using

-Dquarkus.native.additional-build-args=-H:ServiceLoaderFeatureExcludeServices=org.hibernate.bytecode.spi.BytecodeProvider

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?

@zakkak
Copy link
Contributor

zakkak commented Jan 15, 2025

Could you please tell me how did you get reachability graph?

Sure. Unfortunately it's not trivial though, it requires debugging GraalVM.

  1. Run the build with
./mvnw clean install -Dnative -DskipTests -Dquarkus.native.container-build=true -Dquarkus.native.auto-service-loader-registration=true -Dquarkus.native.debug-build-process
  1. Clone GraalVM for JDK 21 source code from https://github.com/graalvm/graalvm-community-jdk21u and open it in your favorite IDE (see you need to get https://github.com/graalvm/mx/ as well and follow https://github.com/graalvm/mx/blob/master/docs/IDE.md).
  2. Attach your IDE/debugger to port 5005
  3. Set a breakpoint at https://github.com/graalvm/graalvm-community-jdk21u/blob/28028ec37c6b48793bb728ca81d76709917ab0f8/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/infrastructure/UniverseMetaAccess.java#L112 with a conditional like the following
reflectionMethod instanceof Method && ((Method) reflectionMethod).name.contains("wait0")
  1. Once the breakpoint is hit, inspect the stack trace to get to org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapScanner.lambda$markReachable$5(ImageHeapScanner.java:452) (where the object is marked reachable.
  2. Inspect that stack frame and specifically the value of the reason parameter and it's previous field.

Image

HTH

@yrodiere
Copy link
Member

Looking into org.hibernate.proxy.pojo.bytebuddy.ByteBuddyProxyHelper I see that the OBJECT field is the one responsible for making wait0 reachable.

AFAIK ByteBuddyProxyHelper is only supposed to be used during static init... maybe we should explicitly remove that class from the native image?

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.

@mbladel
Copy link
Member

mbladel commented Jan 15, 2025

AFAIK ByteBuddyProxyHelper is only supposed to be used during static init... maybe we should explicitly remove that class from the native image?

@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 SessionFactory creation).

@yrodiere
Copy link
Member

yrodiere commented Jan 15, 2025

AFAIK ByteBuddyProxyHelper is only supposed to be used during static init... maybe we should explicitly remove that class from the native image?

@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 SessionFactory creation).

We override that bit in Quarkus, see usages of

And see in particular how we just fail if a proxy wasn't generated ahead of time:

ProxyDefinitions.ProxyClassDetailsHolder detailsHolder = proxyClassDefinitions.getProxyForClass(persistentClass);
if (detailsHolder == null) {
throw new HibernateException("Could not lookup a pre-generated proxy class definition for entity '" + entityName
+ "'. Falling back to enforced eager mode for this entity!");
}

@zakkak
Copy link
Contributor

zakkak commented Jan 16, 2025

AFAIK ByteBuddyProxyHelper is only supposed to be used during static init... maybe we should explicitly remove that class from the native image?

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 It looks like ByteBuddyProxyHelper is only becoming reachable when loading the org.hibernate.bytecode.spi.BytecodeProvider service (due to the use of quarkus.native.auto-service-loader-registration=true). I am not sure removing the class will work (if it's actually reachable through the service). Removing the service makes more sense to me.

@yrodiere
Copy link
Member

@yrodiere It looks like ByteBuddyProxyHelper is only becoming reachable when loading the org.hibernate.bytecode.spi.BytecodeProvider service (due to the use of quarkus.native.auto-service-loader-registration=true). I am not sure removing the class will work (if it's actually reachable through the service). Removing the service makes more sense to me.

The service implementation that should be used in Quarkus at runtime is io.quarkus.hibernate.orm.runtime.service.bytecodeprovider.RuntimeBytecodeProvider, and this implementation is mostly a stub that doesn't rely on ByteBuddyProxyHelper directly -- and indirectly only at static init, through io.quarkus.hibernate.orm.runtime.proxies.ProxyDefinitions#createFromMetadata (though I think GraalVM is smart enough to see it's not being called at runtime).

So I'd suggest:

  • Indeed, removing any implementation of this service except RuntimeBytecodeProvider in native images.
  • If that's not enough, replacing a few methods with no-ops in native-images, to clarify reachability. In particular we could replace io.quarkus.hibernate.orm.runtime.proxies.ProxyDefinitions#createFromMetadata with a no-op/exception throw in the native image (it's not supposed to be called at runtime)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hibernate-orm Hibernate ORM area/native-image kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants