AbstractFileResolvingResource.exists incorrectly reports result for resources inside of spring-boot executable jar #34796
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: regression
A bug that is also a regression
Milestone
Starting from spring-core 6.2.5
AbstractFileResolvingResource.exists
will returntrue
for non existing resources within spring boot executable jar. Earlier versions reported correct value.This seems to be a regression, introduced as a fix of #34607.
For us, it is causing problems with
ReloadableResourceBundleMessageSource
, which takes base names + locale and tries to load base properties file + 2 versions of locale aware files. In our case only base properties file exists and 2 others fail to load.ReloadableResourceBundleMessageSource
relies on exists check to filter out non existing resources before trying to open stream and read them. But in spring 6.2.5 non existing resources are not filtered and it tries to load them, causing warning to be logged. Those messages spam a lot in logs.Attaching example app with reproduction jar-loader.zip. Root pom file contains property
spring-core.version
which can be used to switch between 6.2.4 and 6.2.5The text was updated successfully, but these errors were encountered: