-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Describe the Issue
Spring has to leverage -H:ServiceLoaderFeatureExcludeServices=org.hibernate.bytecode.spi.BytecodeProvider in order to support Hibernate. It works as expected except when users are configured a resource inclusion for META-INF/services/org.hibernate.bytecode.spi.BytecodeProvider that can typically comes from a resource pattern or be generated by the tracing agent as described in spring-projects/spring-framework#35118.
As discussed with @vjovanov, it should not be possible to break -H:ServiceLoaderFeatureExcludeServices with such resource inclusion.
Using the latest version of GraalVM can resolve many issues.
- I tried with the latest version of GraalVM.
GraalVM Version
openjdk version "25.0.1" 2025-10-21 LTS
OpenJDK Runtime Environment Liberica-NIK-25.0.1-1 (build 25.0.1+12-LTS)
OpenJDK 64-Bit Server VM Liberica-NIK-25.0.1-1 (build 25.0.1+12-LTS, mixed mode, sharing)
Operating System and Version
MacOS
Troubleshooting Confirmation
- I tried the suggestions in the troubleshooting guide.
Run Command
./demo
Expected Behavior
A Spring Boot application using the Spring Data JPA starter should not be broken by adding the native image resource META-INF/services/org.hibernate.bytecode.spi.BytecodeProvider
Actual Behavior
A Spring Boot application using the Spring Data JPA starter is broken by adding the native image resource META-INF/services/org.hibernate.bytecode.spi.BytecodeProvider
Steps to Reproduce
- Create a Spring Boot application with https://start.spring.io/#!type=maven-project&language=java&platformVersion=4.0.1&packaging=jar&configurationFileFormat=properties&jvmVersion=25&groupId=com.example&artifactId=demo&name=demo&description=Demo%20project%20for%20Spring%20Boot&packageName=com.example.demo&dependencies=native,data-jpa
- Add a reachability metadata with a resource for
META-INF/services/org.hibernate.bytecode.spi.BytecodeProvider - ./gradlew nativeCompile
Additional Context
No response
Run-Time Log Output and Error Messages
No response