-
Notifications
You must be signed in to change notification settings - Fork 40.2k
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
Hibernate service loading logs HHH000505 warnings for ServiceConfigurationError with Gradle-built jars since 2.5.10 when using Java 11 or later #30413
Comments
Thanks for the sample, @dreis2211, and apologies for the change in behaviour. As far as I can tell, this has alway been broken with Maven and, unfortunately, #28562 made things behave the same way with Gradle. I don't think it makes sense to leave |
No need to apologize - I could apologize for not noticing earlier. I'm not sure I get the following:
Should we maybe involve someone from Hibernate? After all, with a vanilla |
In 2.5.9, prior to #28562, the Gradle plugin moved
In 2.5.10 and later, it gets left in the root:
2.5.10's behaviour doesn't make sense as we now have a file that's visible to the system class loader that refers to types that are only visible to Boot's ClassLoader. So, I think it makes sense to move |
Using Boot's Using Hibernate's
This leaves the It's quite an odd arrangement to have |
I'm afraid I overlooked that the service loading seems to be still working. It's only logged as a big warning apparently, but the class is still loaded properly (probably by at least one of the involved classloaders). This changes the urgency drastically. Feel free to rephrase the ticket as needed - I'm sorry I didn't notice that earlier. It might still makes sense to ignore |
Thanks very much for the clarification, Christoph. There's no need to apologise! I've just confirmed with your sample that it's "just" a warning message and also that the problem doesn't occur with Java 8. I believe the latter's because Hibernate doesn't use its |
We're going to align both Maven and Gradle to put the file under |
Hi,
after upgrading an internal customer project today from Spring-Boot 2.5.9 to 2.5.11 I noticed a malfunction of what I believe is a regression caused by #28562 with stacktraces similar to the following:
I created a minimal reproduction project https://github.com/dreis2211/hibernate-service-loader-meta-inf-demo that showcases the problem. (We're not using the internals directly in reality, it's just the most simple way to showcase things ;-) ) Essentially the service loading of Hibernate cannot find services anymore when run as a JAR.
I'm still not quite sure if this a problem in Hibernate, after all (because a vanilla
ServiceLoader.load
doesn't complain.). But between 2.5.9 and 2.5.11 no Hibernate upgrade happened (version 5.4.33 is used throughout).I wonder if the following should ignore
META-INF/services
folders.spring-boot/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootJar.java
Line 116 in a5ec85b
Let me know if you need anything from me to resolve the issue.
Cheers,
Christoph
The text was updated successfully, but these errors were encountered: