Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upMultiple PropertySourcesPlaceholderConfigurers do not work with placeholder defaults [SPR-10240] #14873
Comments
This comment has been minimized.
This comment has been minimized.
Paul Tomlin commented Looks like this may duplicate issue #14623 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Paul Tomlin commented Thanks Phil, I've made up a local workaround which involves using a separate namespace and a PropertySource registration mechanism. <environment:property-source location="..."/> The handler simply creates an EnvironmentAware BeanFactoryPostProcessor, which registers the resulting PropertySource with the environment. Seems to work sufficiently for my needs, I'll throw a Github project up when I have a chance. |
This comment has been minimized.
This comment has been minimized.
spring-issuemaster
closed this
Feb 7, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
spring-issuemaster commentedJan 29, 2013
•
edited
Paul Tomlin opened SPR-10240 and commented
While issue #14356 discusses this with respect to PropertyPlaceholderConfigurer, this issue specifically deals with the PropertySourcesPlaceholderConfigurer. I feel there is sufficient difference in their intended usage to warrant another ticket.
A PSPC will register the source with the environment, from which it may later be used by any number of locations requiring property lookup.
The problem is that the current implementation also processes the bean factory for every instance of PSPC that is configured. Like #14356, this causes placeholders which are not matched by the current environment to be replaced with their defaults, before later PSPCs have had a chance to load and populate the environment.
In this scenario
@ignore-unresolvable
doesn't help.The issue really is that there's no way to register a property source, from within XML, without also having all placeholders processed.
There are multiple potential fixes for this, but I'm trying to illustrate there is a real problem.
The below test fails on bean2 because value == "Borked"
Affects: 3.1.4, 3.2.1
Issue Links:
@Value
default value behavior ("duplicates")