-
Notifications
You must be signed in to change notification settings - Fork 40.9k
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
Metadata reading during configuration class parsing uses the default resource loader rather than the application's resource loader #39321
Conversation
…tion's resource loader
@vjh0107 Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@vjh0107 Thank you for signing the Contributor License Agreement! |
Thanks for the PR. There's a quite high risk of introducing a regression with a change like this so the bar has to be quite high for making a change. As such, I don't think that we can merge this without knowing more about your use case and why the current arrangement is insufficient. A minimal sample that shows things not working with the current code and that works with your proposed change in place would be very useful. |
Hello @wilkinsona, Here are the codes where BeanClassLoaderAware injects the ClassLoader from the ResourceLoader defined in the application: This is the stack trace of the exception:
|
I think this is a sensible change to make. Looking at this code, it seems like our fallback code uses the resource loader where as Flagging for team attention to see if we think it's too risky for a patch release change. |
We discussed this today and we think it's going to be safe enough to do in 3.1.x |
# Conflicts: # gradle.properties # spring-boot-project/spring-boot-dependencies/build.gradle # spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/properties/TestcontainersPropertySource.java # spring-boot-project/spring-boot-tools/spring-boot-loader-classic/src/main/java/org/springframework/boot/loader/LaunchedURLClassLoader.java # spring-boot-project/spring-boot-tools/spring-boot-loader-classic/src/main/java/org/springframework/boot/loader/archive/JarFileArchive.java # spring-boot-project/spring-boot-tools/spring-boot-loader-classic/src/main/java/org/springframework/boot/loader/jar/Handler.java # spring-boot-project/spring-boot-tools/spring-boot-loader-classic/src/main/java/org/springframework/boot/loader/jar/JarFile.java
…tion's resource loader See gh-39321
Thank you very much and congratulations on your first contribution 🎉! |
This PR and its forward port issues have truncated titles. |
Thanks, @izeye. I've updated the titles. |
Mea culpa. Thanks! |
I run Spring Boot in a complex resource loading environment, and no matter how I declare the resource loader and start the application, it always starts with the DefaultResourceLoader when class readings.