When FailureAnalyzers
, a SpringBootExceptionReporter
, is created, the environment prepared by SpringApplication
hasn't been set on the application context. This results in any EnvironmentAware
FailureAnalyzer
having the context's default environment injected rather than the environment that will be in place when the context is refreshed.
Comment From: wilkinsona
This problem's specific to 2.3.x. It was fixed in 2.4 as a side-effect of https://github.com/spring-projects/spring-boot/commit/f89b99bdbc4dc682279f414b5f414acaf362812d.