-
Notifications
You must be signed in to change notification settings - Fork 40.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Placeholders are not resolved when a property in the Environment has a String[] value #29642
Comments
@darkman97i Spring Boot 2.4.x has reached end of OSS support. Can you try with Spring Boot version 2.5.9 or 2.6.3 to see if the problem still exists? From what I can tell by looking at the code, the property is bound using the binder which should take care of placeholder resolution. |
I can confirm it happens with 2.5.9 I will try to debug the proposed class looking for the point of what it changes. |
The problem's caused by the rather unusual presence of a
The problem doesn't occur if a more conventional comma-separated string is used instead:
When a Lines 54 to 60 in 8bc792f
It would appear to be straightforward to look for a |
Thanks, @wilkinsona and @mbhave for your quick answer. Confirmed that replacing the String[] by a single String comma-separated it works. For your information, I got the configuration with String[] from version 2.0.3.RELEASE to 2.3.12.RELEASE ).In my opinion, one way to add the parameters is better than two ways, for me comma-separated is comfortable and clear to be used. The only scenario I can imagine could have sense working with String[] will be when a single String contains in the middle some comma that should not be used for splitting ( rare case ). |
Looking at the code in 2.3.x, it looks like this worked specifically for this property because we didn't use the While adding support for |
I think we should align to what Framework does. |
Alright, let's leave things as they are which already aligns with Framework. |
I think I ran into this after running
In the
It worked once, but all the tests (even completely unrelated ones in a different SpringBootContext) started failing with the error:
|
Hi
Tested with:
After upgrading from version 2.3.12.RELEASE to version 2.4.0 I have found this issue. I have also tested with the latest version 2.4.13 and also it happens. During the loading of the configuration properties file is not able to replace ${catalina.home} with the path of the tomcat.
I have read upgrading-from-spring-boot-23 and Spring-Boot-Config-Data-Migration-Guide but I have not been able to find the reason why it happens. Finally, I have also added in the application.properties file the parameter
spring.config.use-legacy-processing=true
and nothing was solved. I think has not relation with the issue.Code sample
When the line
is replaced by file system path the application finds the file and startup as expected
Take from here the startup log with the error startup-error.log
Thanks for your time
Josep
The text was updated successfully, but these errors were encountered: