Application Startup Fails For Existing, Non-Optional Config Location, Resulting In ConfigDataLocationNotFoundException #24499
Labels
type: regression
A regression from a previous release
Milestone
Since upgrading from
Spring Boot 2.4.0
toSpring Boot 2.4.1
a existing, non-optional config location will stop our application from starting up by throwing aConfigDataLocationNotFoundException: Config data location '[PATH]' cannot be found
exception.I provided a sample application for reproduction: Demo_Application_For_Reproduction.zip
In this demo application a config location will be created in the users home directory under
~/additional/config/location/[CURRENT_MILLIS]
and within it a dummy config file namedapplication-test.properties
is created.This config location will than be registered as non-optional using the
spring.config.additional-location
application property upon configuring the Spring Boot application prior to its startup:According to the latest Spring Boot Reference Documentation the
optional:
prefix is only required if a config location might not be existing in order to prevent receiving theConfigDataLocationNotFoundException
:So this above provided application should startup which it did with
Spring Boot 2.4.0
but which it does no longer withSpring Boot 2.4.1
resulting in the above mentioned exception.But as soon as we start the application with
test
as active profile, thus triggering the search for and parsing of theapplication-test.properties
file within the newly created and added config location, the registered additional config location is being found and the application starts as expected.I think that the commit 3dc03ac2752a06e015fc8ae7a6eba483b2cc863e could have introduced this behaviour.
The text was updated successfully, but these errors were encountered: