You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
✖️Application fails immediately because the config server is not reachable, even if it is declared optional in the profile dev.
Test 2: activate config server with the prod profile only, using property spring.config.activate.on-profile, and run application with no profile.
# src/main/resources/config/application.ymlspring.config.import: configserver:http://...spring.config.activate.on-profile: prodapplication.prop: value
✔️Application does not attempt to join the config server
✖️Application fails later because property application.prop is null after bean validation with @NotNull (seems it has not been loaded correctly from the application.yml file).
May be related to other issues created recently in the project, but not sure they are about the exact same problem: #1802, #1801, #1797, #1795
I also tried with Spring Boot 2.4.3 without success.
Thanks in advance for your help.
BR
The text was updated successfully, but these errors were encountered:
I'm afraid that having multiple spring.config.import statements isn't like a normal property. An import in a profile doesn't override the one in main. They all are imported. Something like this seems to work. (where config server has foo.message).
Profile: dev
no config server, foo.message=dev-message
w/ config server, foo.message=fromconfigserver-message
Profile: prod
no config server, fails because it is not optional
w/ config server, foo.message=fromconfigserver-message
Hello,
Describe the bug
Environment:
What's happening:
dev
profile, by overriding propertyspring.config.import
, and run application withdev
profile.✖️Application fails immediately because the config server is not reachable, even if it is declared optional in the profile
dev
.prod
profile only, using propertyspring.config.activate.on-profile
, and run application with no profile.✔️Application does not attempt to join the config server
✖️Application fails later because property
application.prop
is null after bean validation with@NotNull
(seems it has not been loaded correctly from theapplication.yml
file).May be related to other issues created recently in the project, but not sure they are about the exact same problem: #1802, #1801, #1797, #1795
I also tried with Spring Boot 2.4.3 without success.
Thanks in advance for your help.
BR
The text was updated successfully, but these errors were encountered: