Skip to content

4.x: upgrades Hibernate to 6.6.*; fixes related native-image problems#10904

Draft
ljnelson wants to merge 11 commits intohelidon-io:mainfrom
ljnelson:4.x-experimental-hibernate-refactor
Draft

4.x: upgrades Hibernate to 6.6.*; fixes related native-image problems#10904
ljnelson wants to merge 11 commits intohelidon-io:mainfrom
ljnelson:4.x-experimental-hibernate-refactor

Conversation

@ljnelson
Copy link
Member

@ljnelson ljnelson commented Dec 12, 2025

This PR addresses (at least) two issues with a (very deliberately) minimal number of changes, and is intended to supersede #10487.

First, it addresses #10441, and should unlock the door for future Hibernate upgrades.

The tricky part here is that Hibernate has chosen to deliberately ignore (!) a very specific prescription of the Jakarta Persistence 3.1 specification in their 6.6 "series" and beyond, despite very explicit text in the JPA specification to the contrary. Our tests, which have always enforced this area of the specification, broke, and are here amended to make a special case for modern Hibernate versions such that they pass. Is that good or bad? I don't know, but Hibernate is widely used. At least we can now tell whether a given future test failure is due to one provider or the other.

(This is a strange and blunt enough (alleged) specification violation that it might be worth an official Jakarta EE Challenge™, whatever that might mean. I can't see how anyone could read the relevant section to permit what Hibernate does here.)

This required the ability for a given JUnit test to detect whether it is running "with" Hibernate or not (our JUnit tests already run all tests under both Hibernate and Eclipselink). That change is part of this PR.

Next, it addresses (I hope) #10688. It appears that this was fixed by modern versions of the Hibernate 6.x series.

Finally, it permits (at least, locally) the mp-2 test to pass when run with the native-image profile. This did not require any code changes, unlike in #10487, but did require an additional --initialize-at-run-time clause in the META-INF/native-image.properties classpath resource. Unlike with #10487, this also didn't require using the Hibernate-supplied GraalVM native image Feature implementation recommended by the Hibernate team (the features it provides seem already to be effectively provided in a non-standard way by the Helidon io.helidon.integrations.graal.mp.nativeimage.extension.HelidonMpFeature or the Helidon io.helidon.integrations.graal.nativeimage.extension.HelidonReflectionFeature (can't remember which), or perhaps they really weren't ever needed here). The recommended "trace" agent clumsily provided, if you know how to read its output, the options for native-image.properties I've added, as recommended.

I will let the pipelines be the final judge of whether this all works or not, since as of writing this description I'm sure I haven't locally accounted for all possible failures.

@ljnelson ljnelson self-assigned this Dec 12, 2025
@ljnelson ljnelson added P3 jpa/jta dependencies Pull requests that update a dependency file testing java Pull requests that update Java code 4.x Version 4.x data Helidon Data (SE feature) labels Dec 12, 2025
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Dec 12, 2025
@ljnelson ljnelson requested a review from tjquinno December 12, 2025 04:29
@ljnelson ljnelson added this to the 4.4.0 milestone Dec 12, 2025
…opedSynchronizedEntityManager.java

Signed-off-by: Laird Nelson <[email protected]>
@ljnelson
Copy link
Member Author

When run under my machine's local native-image whose --version output reports:

lairdnelson@lairdnelson-mac mp-2 % ${GRAALVM_HOME}/bin/native-image --version
native-image 21.0.6 2025-01-21
GraalVM Runtime Environment Oracle GraalVM 21.0.6+8.1 (build 21.0.6+8-LTS-jvmci-23.1-b55)
Substrate VM Oracle GraalVM 21.0.6+8.1 (build 21.0.6+8-LTS, serial gc, compressed references)

…the mp-2 test runs fine on my Mac M1. The roughly equivalent pipeline counterpart appears to be failing, opaquely. The GRAALVM_VERSION environment variable value in the pipeline appears to be 21.0.3. Other pipeline indications seem to say the actual version is 21.0.3+7-LTS. So a micro version of GraalVM's native image may matter here, but I can't see it. I therefore seemingly have no ability to troubleshoot this aspect further locally. Maybe the pipeline should move to a different micro-version of native image?

@ljnelson
Copy link
Member Author

Or, given the arbitrary cancellation, perhaps a timeout is being hit?

@ljnelson
Copy link
Member Author

ljnelson commented Dec 12, 2025

It's hard to understand the pipeline failures, but it now appears that tests/native-image-mp2-macos works just fine (which corresponds to my local experience), and tests/native-image-mp2-linux fails. (The Windows version also succeeds. So the failure would seem to be restricted to Linux.)

The Linux-only (?!) failure has the following partial stack trace:

Caused by: java.util.ServiceConfigurationError: org.hibernate.bytecode.spi.BytecodeProvider: Provider org.hibernate.bytecode.internal.bytebuddy.BytecodeProviderImpl could not be instantiated
	at [email protected]/java.util.ServiceLoader.fail(ServiceLoader.java:586)
	at [email protected]/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:813)
	at [email protected]/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:729)
	at [email protected]/java.util.ServiceLoader$3.next(ServiceLoader.java:1403)
	at org.hibernate.bytecode.internal.BytecodeProviderInitiator.getBytecodeProvider(BytecodeProviderInitiator.java:77)

…which also says:

Caused by: com.oracle.svm.core.jdk.UnsupportedFeatureError: No classes have been predefined during the image build to load from bytecodes at runtime.
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:121)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.hub.PredefinedClassesSupport.throwNoBytecodeClasses(PredefinedClassesSupport.java:76)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.hub.PredefinedClassesSupport.loadClass(PredefinedClassesSupport.java:130)
	at [email protected]/java.lang.ClassLoader.defineClass(ClassLoader.java:280)
	at net.bytebuddy.utility.dispatcher.JavaDispatcher$DynamicClassLoader.invoker(JavaDispatcher.java:1384)
	at net.bytebuddy.utility.dispatcher.JavaDispatcher$InvokerCreationAction.run(JavaDispatcher.java:460)
	at net.bytebuddy.utility.dispatcher.JavaDispatcher$InvokerCreationAction.run(JavaDispatcher.java:453)
	at [email protected]/java.security.AccessController.executePrivileged(AccessController.java:129)
	at [email protected]/java.security.AccessController.doPrivileged(AccessController.java:319)
	at net.bytebuddy.utility.dispatcher.JavaDispatcher.doPrivileged(JavaDispatcher.java)
	at net.bytebuddy.utility.dispatcher.JavaDispatcher.<clinit>(JavaDispatcher.java:88)
	at net.bytebuddy.description.type.TypeDescription$ForLoadedType.<clinit>(TypeDescription.java:8725)
	at net.bytebuddy.matcher.ElementMatchers.isFinalizer(ElementMatchers.java:1624)
	at org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState$ProxyDefinitionHelpers.<init>(ByteBuddyState.java:363)
	at org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState.<init>(ByteBuddyState.java:75)
	at org.hibernate.bytecode.internal.bytebuddy.BytecodeProviderImpl.<init>(BytecodeProviderImpl.java:125)
	at org.hibernate.bytecode.internal.bytebuddy.BytecodeProviderImpl.<init>(BytecodeProviderImpl.java:117)
	at [email protected]/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
	at [email protected]/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
	at [email protected]/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:789)

I'm not sure why only the Linux native image mp-2 test runs into this where the Mac OS one does not.

@ljnelson
Copy link
Member Author

This seems vaguely (and I do mean vaguely) related: oracle/graal#7789

@ljnelson
Copy link
Member Author

I've pushed a somewhat blind commit (since I don't have a Linux box locally) to try to get mp-2 to pass on Linux. I still am not sure why this only fails on Linux. The change I made in f06c891 specifies packages instead of classes. The GraalVM native image documentation does not say what the format of packages supplied to the relevant option is. This commit still allowed for local tests on my Mac M1 to pass. We'll see what the pipelines do.

…ddy classes at build time

Signed-off-by: Laird Nelson <[email protected]>
@ljnelson
Copy link
Member Author

ljnelson commented Dec 12, 2025

Looking harder at the stack trace above:

Hibernate loads a org.hibernate.bytecode.internal.bytebuddy.BytecodeProviderImpl. There is a lot of ceremonial code in BytecodeProviderInitiator that makes it look like a different BytecodeProvider can be used, but that will never be the case, because the service loader file is part of hibernate-core. So BytecodeProviderImpl it is.

For some reason the Mac OS native-image is happy to simply recognize this and use it as-is. The Linux native-image doesn't seem to pick this up automatically. I don't know why not. My working hypothesis is that it's just non-deterministic in some way.

The error that the stack trace shows is because the BytecodeProviderImpl ends up statically loading net.bytebuddy.utility.dispatcher.JavaDispatcher$DynamicClassLoader at runtime, and one of the things that it does is try to load the void class.

Loading the void class involves statically initializing the TypeDescription class, which involves creating a JavaDispatcher.

JavaDispatcher is a Byte Buddy class that kind of bootstraps Byte Buddy's internal functionality.

Since Byte Buddy is inexorably part of Hibernate, it might pay to build-time-initialize certain Byte Buddy classes such as these. My latest commit does this. As usual my local native image test runs fine. I'm expecting the Linux test to fail again but hopefully with more useful information.

@ljnelson
Copy link
Member Author

ljnelson commented Dec 12, 2025

So far so good: https://github.com/helidon-io/helidon/actions/runs/20178140513/job/57931887990?pr=10904

{time passes}

Boo. But it's a better error this time:

Caused by: java.util.ServiceConfigurationError: org.hibernate.bytecode.spi.BytecodeProvider: Provider org.hibernate.bytecode.internal.bytebuddy.BytecodeProviderImpl could not be instantiated
	at [email protected]/java.util.ServiceLoader.fail(ServiceLoader.java:586)
	at [email protected]/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:813)
	at [email protected]/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:729)
	at [email protected]/java.util.ServiceLoader$3.next(ServiceLoader.java:1403)
	at org.hibernate.bytecode.internal.BytecodeProviderInitiator.getBytecodeProvider(BytecodeProviderInitiator.java:77)
	at org.hibernate.bytecode.internal.BytecodeProviderInitiator.buildDefaultBytecodeProvider(BytecodeProviderInitiator.java:63)
	at org.hibernate.jpa.internal.enhance.EnhancingClassTransformerImpl.<init>(EnhancingClassTransformerImpl.java:39)
	at org.hibernate.jpa.boot.internal.PersistenceUnitInfoDescriptor.pushClassTransformer(PersistenceUnitInfoDescriptor.java:130)
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:349)
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:199)
	at org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:35)
	at org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:102)
	at org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilder(HibernatePersistenceProvider.java:169)
	at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:142)
	at io.helidon.integrations.cdi.jpa.PersistenceExtension.produceEntityManagerFactory(PersistenceExtension.java:1466)
	at io.helidon.integrations.cdi.jpa.PersistenceExtension.lambda$addContainerManagedEntityManagerFactoryBeans$17(PersistenceExtension.java:1290)
	at org.jboss.weld.bootstrap.events.configurator.BeanConfiguratorImpl$CreateCallback.create(BeanConfiguratorImpl.java:383)
	at org.jboss.weld.bootstrap.events.configurator.BeanConfiguratorImpl$CreateCallback.access$700(BeanConfiguratorImpl.java:350)
	at org.jboss.weld.bootstrap.events.configurator.BeanConfiguratorImpl$ImmutableBean.create(BeanConfiguratorImpl.java:522)
	at org.jboss.weld.contexts.AbstractContext.get(AbstractContext.java:96)
	at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:106)
	at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
	at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:706)
	at org.jboss.weld.bean.builtin.InstanceImpl.getBeanInstance(InstanceImpl.java:267)
	at org.jboss.weld.bean.builtin.InstanceImpl.access$200(InstanceImpl.java:73)
	at org.jboss.weld.bean.builtin.InstanceImpl$InstanceImplIterator.next(InstanceImpl.java:340)
	at io.helidon.integrations.cdi.jpa.PersistenceExtension.workAroundWeldBeanMetadataCreationBug(PersistenceExtension.java:665)
	at [email protected]/java.lang.reflect.Method.invoke(Method.java:580)
	at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:99)
	... 17 more
Caused by: org.graalvm.nativeimage.MissingReflectionRegistrationError: The program tried to reflectively access the proxy class inheriting [net.bytebuddy.description.type.TypeDescription$ForLoadedType$Dispatcher] without it being registered for runtime reflection. Add [net.bytebuddy.description.type.TypeDescription$ForLoadedType$Dispatcher] to the dynamic-proxy metadata to solve this problem. Note: The order of interfaces used to create proxies matters. See https://www.graalvm.org/latest/reference-manual/native-image/metadata/#dynamic-proxy for help.
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.reflect.MissingReflectionRegistrationUtils.forProxy(MissingReflectionRegistrationUtils.java:89)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.reflect.proxy.DynamicProxySupport.getProxyClass(DynamicProxySupport.java:176)
	at [email protected]/java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:47)
	at [email protected]/java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1034)
	at net.bytebuddy.utility.dispatcher.JavaDispatcher.run(JavaDispatcher.java:375)
	at [email protected]/java.security.AccessController.executePrivileged(AccessController.java:129)
	at [email protected]/java.security.AccessController.doPrivileged(AccessController.java:319)
	at net.bytebuddy.description.type.TypeDescription$ForLoadedType.doPrivileged(TypeDescription.java)
	at net.bytebuddy.description.type.TypeDescription$ForLoadedType.<clinit>(TypeDescription.java:8725)
	at net.bytebuddy.matcher.ElementMatchers.isFinalizer(ElementMatchers.java:1624)
	at org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState$ProxyDefinitionHelpers.<init>(ByteBuddyState.java:363)
	at org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState.<init>(ByteBuddyState.java:75)
	at org.hibernate.bytecode.internal.bytebuddy.BytecodeProviderImpl.<init>(BytecodeProviderImpl.java:125)
	at org.hibernate.bytecode.internal.bytebuddy.BytecodeProviderImpl.<init>(BytecodeProviderImpl.java:117)
	at [email protected]/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
	at [email protected]/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
	at [email protected]/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:789)

@ljnelson
Copy link
Member Author

My latest commit adds proxy-config.json (whose format seems to be undocumented; I followed examples from the native image source code itself) in an attempt to make more progress with the Linux failure. As usual, the native image tests on my Mac run fine with or without this change.

@ljnelson
Copy link
Member Author

Moving forward. Now see:

Exception in thread "main" jakarta.enterprise.event.ObserverException
	at [email protected]/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
	at [email protected]/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
	at org.jboss.weld.security.NewInstanceAction.run(NewInstanceAction.java:40)
	at [email protected]/java.security.AccessController.executePrivileged(AccessController.java:114)
	at [email protected]/java.security.AccessController.doPrivileged(AccessController.java:571)
	at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:40)
	at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:79)
	at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:107)
	at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:88)
	at org.jboss.weld.injection.MethodInvocationStrategy$DefaultMethodInvocationStrategy.invoke(MethodInvocationStrategy.java:153)
	at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:350)
	at org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:136)
2025.12.12 21:13:41 INFO io.helidon.Main Thread[#41,helidon-shutdown-thread,5,main]: Shutdown requested by JVM shutting down
	at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:328)
	at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:298)
	at jakarta.enterprise.inject.spi.ObserverMethod.notify(ObserverMethod.java:142)
	at org.jboss.weld.util.Observers.notify(Observers.java:176)
	at org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:307)
	at org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:293)
	at org.jboss.weld.event.EventImpl.fire(EventImpl.java:96)
	at io.helidon.microprofile.cdi.HelidonContainerImpl.doStart(HelidonContainerImpl.java:307)
	at io.helidon.common.context.Contexts.runInContext(Contexts.java:137)
	at io.helidon.microprofile.cdi.HelidonContainerImpl.start(HelidonContainerImpl.java:254)
	at io.helidon.microprofile.server.ServerImpl.start(ServerImpl.java:78)
	at io.helidon.tests.integration.packaging.mp2.Mp2Main.main(Mp2Main.java:45)
	at [email protected]/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
Caused by: java.util.ServiceConfigurationError: org.hibernate.bytecode.spi.BytecodeProvider: Provider org.hibernate.bytecode.internal.bytebuddy.BytecodeProviderImpl could not be instantiated
	at [email protected]/java.util.ServiceLoader.fail(ServiceLoader.java:586)
	at [email protected]/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:813)
	at [email protected]/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:729)
	at [email protected]/java.util.ServiceLoader$3.next(ServiceLoader.java:1403)
	at org.hibernate.bytecode.internal.BytecodeProviderInitiator.getBytecodeProvider(BytecodeProviderInitiator.java:77)
	at org.hibernate.bytecode.internal.BytecodeProviderInitiator.buildDefaultBytecodeProvider(BytecodeProviderInitiator.java:63)
	at org.hibernate.jpa.internal.enhance.EnhancingClassTransformerImpl.<init>(EnhancingClassTransformerImpl.java:39)
	at org.hibernate.jpa.boot.internal.PersistenceUnitInfoDescriptor.pushClassTransformer(PersistenceUnitInfoDescriptor.java:130)
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:349)
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:199)
	at org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:35)
	at org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:102)
	at org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilder(HibernatePersistenceProvider.java:169)
	at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:142)
	at io.helidon.integrations.cdi.jpa.PersistenceExtension.produceEntityManagerFactory(PersistenceExtension.java:1466)
	at io.helidon.integrations.cdi.jpa.PersistenceExtension.lambda$addContainerManagedEntityManagerFactoryBeans$17(PersistenceExtension.java:1290)
	at org.jboss.weld.bootstrap.events.configurator.BeanConfiguratorImpl$CreateCallback.create(BeanConfiguratorImpl.java:383)
	at org.jboss.weld.bootstrap.events.configurator.BeanConfiguratorImpl$CreateCallback.access$700(BeanConfiguratorImpl.java:350)
	at org.jboss.weld.bootstrap.events.configurator.BeanConfiguratorImpl$ImmutableBean.create(BeanConfiguratorImpl.java:522)
	at org.jboss.weld.contexts.AbstractContext.get(AbstractContext.java:96)
	at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:106)
	at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
	at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:706)
	at org.jboss.weld.bean.builtin.InstanceImpl.getBeanInstance(InstanceImpl.java:267)
	at org.jboss.weld.bean.builtin.InstanceImpl.access$200(InstanceImpl.java:73)
	at org.jboss.weld.bean.builtin.InstanceImpl$InstanceImplIterator.next(InstanceImpl.java:340)
	at io.helidon.integrations.cdi.jpa.PersistenceExtension.workAroundWeldBeanMetadataCreationBug(PersistenceExtension.java:665)
	at [email protected]/java.lang.reflect.Method.invoke(Method.java:580)
	at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:99)
	... 17 more
Caused by: java.lang.ExceptionInInitializerError
	at net.bytebuddy.implementation.bind.MethodDelegationBinder$AmbiguityResolver.<clinit>(MethodDelegationBinder.java:790)
	at net.bytebuddy.implementation.MethodDelegation.withDefaultConfiguration(MethodDelegation.java:606)
	at net.bytebuddy.implementation.MethodDelegation.to(MethodDelegation.java:276)
	at org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState$ProxyDefinitionHelpers$1.run(ByteBuddyState.java:383)
	at org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState$ProxyDefinitionHelpers$1.run(ByteBuddyState.java:379)
	at org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState$ProxyDefinitionHelpers.<init>(ByteBuddyState.java:389)
	at org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState.<init>(ByteBuddyState.java:75)
	at org.hibernate.bytecode.internal.bytebuddy.BytecodeProviderImpl.<init>(BytecodeProviderImpl.java:125)
	at org.hibernate.bytecode.internal.bytebuddy.BytecodeProviderImpl.<init>(BytecodeProviderImpl.java:117)
	at [email protected]/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
	at [email protected]/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
	at [email protected]/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:789)
	... 44 more
Caused by: java.lang.IllegalStateException: size = 0
	at net.bytebuddy.matcher.FilterableList$AbstractBase.getOnly(FilterableList.java:139)
	at net.bytebuddy.implementation.bind.annotation.BindingPriority$Resolver.<clinit>(BindingPriority.java:73)
	... 56 more

@ljnelson
Copy link
Member Author

My latest commit follows the <clinit> markings and adds more classes to initialize at build time. Again native image tests pass locally on my Mac. Let's see what the pipeline says this time about Linux.

@ljnelson
Copy link
Member Author

Moving back to draft status

@ljnelson ljnelson marked this pull request as draft December 12, 2025 22:10
@ljnelson
Copy link
Member Author

Slugging away but it is beginning to look like aggressive build-time initialization won't work either. Having spent a day or so on this I will probably end up closing it. It appears that indeed the only path forward is via native image substitutions and related surgery. If I can't make any further headway then I'll simply approve #10487 in whatever its current state is.

@ljnelson ljnelson removed this from the 4.4.0 milestone Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.x Version 4.x data Helidon Data (SE feature) dependencies Pull requests that update a dependency file java Pull requests that update Java code jpa/jta OCA Verified All contributors have signed the Oracle Contributor Agreement. P3 testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4.x: Tests fail when upgrading to Hibernate 6.6.23.Final 4.x: JPA integration test fail with Java 26 - Duplicated stack frame bytecode index: 54

1 participant