From https://github.com/spring-projects/spring-boot/issues/42468#issuecomment-2382454017
https://github.com/spring-projects/spring-boot/blob/da1edd3833e8d99b2f85855f09864ee6d9880fa4/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/StringToFileConverter.java#L37
https://github.com/spring-projects/spring-boot/blob/da1edd3833e8d99b2f85855f09864ee6d9880fa4/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/java/JavaLoggingSystem.java#L106
https://github.com/spring-projects/spring-boot/blob/da1edd3833e8d99b2f85855f09864ee6d9880fa4/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/Log4J2LoggingSystem.java#L280
https://github.com/spring-projects/spring-boot/blob/da1edd3833e8d99b2f85855f09864ee6d9880fa4/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/logback/LogbackLoggingSystem.java#L254
https://github.com/spring-projects/spring-boot/blob/da1edd3833e8d99b2f85855f09864ee6d9880fa4/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ssl/jks/JksSslStoreBundle.java#L119
https://github.com/spring-projects/spring-boot/blob/da1edd3833e8d99b2f85855f09864ee6d9880fa4/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ssl/pem/PemContent.java#L122
https://github.com/spring-projects/spring-boot/blob/da1edd3833e8d99b2f85855f09864ee6d9880fa4/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ssl/BundleContentProperty.java#L73
In addition, on main, there is also the following:
https://github.com/spring-projects/spring-boot/blob/f908fcd1f3d962d8d8fb930b622d61d009e31fda/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseAutoConfiguration.java#L120
I think we should probably change each of them to use getClass().getClassLoader() as the resource loader's class loader but I'd like to review them with the rest of the team in case I'm overlooking something.
Comment From: philwebb
With the updates for #42468 and #42835 we now have the following situation:
StringToFileConverter
Uses the default class loader (same as 3.2.x)
JavaLoggingSystem, Log4J2LoggingSystem, LogbackLoggingSystem
Uses the default class loader
JksSslStoreBundle, PemContent, BundleContentProperty
Uses the default class loader when used directly or the ApplicationContext resource loader when created from application.properties.
CouchbaseAutoConfiguration
Uses the ApplicationContext resource loader.
Comment From: philwebb
We discussed this today and think this is the best we can do for now.