Due to this change in Hibernate 6.2, Bytebuddy class enhancement is now invoked via SpringHibernateJpaPersistenceProvider -> PersistenceUnitInfoDescriptor - > EnhancingClassTransformerImpl -> BytecodeProviderInitiator.buildDefaultBytecodeProvider(), breaking Hibernate integration when compiling to native images.

This change updates the PersistenceUnitInfoDescriptor instance created by SpringHibernateJpaPersistenceProvider in order to skip the class transformer with native.

Footprint optimization will require completing #29549 is is outside of the scope of this change.

Comment From: sdeleuze

See also related issues: - https://github.com/oracle/graalvm-reachability-metadata/pull/286 - https://github.com/spring-projects/spring-boot/issues/35423

Comment From: edeandrea

Hi @sdeleuze if I use Spring Framework 6.0.10-SNAPSHOT should this issue be resolved? Or is there more to it?

Comment From: edeandrea

I opened oracle/graalvm-reachability-metadata#297 a little while ago, as this fix on its own doesn't seem to fix the issue.

Comment From: davidbilge

@edeandrea using Spring Framework 6.0.10-SNAPSHOT should be enough, provided the maven-native-plugin uses the latest available reachability metadata version (0.3.1 at the time of writing).

See my comment https://github.com/spring-projects/spring-boot/issues/35659#issuecomment-1566804157 for more details.

Comment From: edeandrea

Thank you @davidbilge but that unfortunately didn't work.

Comment From: davidbilge

Thank you @davidbilge but that unfortunately didn't work.

Did you try to use a specific version (0.3.1) of the reachability metadata in your pom.xml?

Comment From: edeandrea

Yes I did. I opened https://github.com/oracle/graalvm-reachability-metadata/issues/297 for it.

Comment From: sdeleuze

We are going to release GraalVM metadata 0.3.2 and Native Build Tools 0.9.23 that contains all Hibernate 6.2 fixes.