Nested URLs return null from classLoader.getResource("") causing ClassPathResource failures #38524
Labels
type: regression
A regression from a previous release
Milestone
My application has no default configuration file, only profile specific ones (
application-profile1.properties
,application-profile2.properties
, etc.). The user must activate a specific profile to successfully run the application.To improve usability, I check whether a profile has been activated (using
spring.profiles.active
orSPRING_PROFILES_ACTIVE
) in mymain
method (beforeSpringApplication#run
). If not, I display an error message and exit.To improve usability even further, the error message attempts to list the available profiles from which the user must choose. It does so by passing
"classpath:application-*.properties"
toorg.springframework.core.io.support.PathMatchingResourcePatternResolver#getResources
to enumerate the available configuration files.In 3.1 and 3.2 with
loaderImplementation=CLASSIC
this works but in 3.2 withoutloaderImplementation=CLASSIC
it fails with:Not sure if this is a regression or intended (and if so how best to achieve my end with the new implementation).
The text was updated successfully, but these errors were encountered: