Feb 13th, 2011, 03:35 AM
multiple configuration files causes problem in property-placeholder
I have 2 bean configuration files: a-ctx.xml , b-ctx.xml
In each of them I have one context: property-placeholder refers to a.properties and b.properties.
When I both of load bean configuration files (in different ways. loading an array of them, in test case annotation, ...) the properties file in second loaded file is not loaded.
Is this a bug?
Feb 13th, 2011, 07:00 AM
By more tests I see this problem essentially is related to Spring behavior with 2 property-placeholder in a context. Spring ignores the second.
But What is solution? I have a configuration file and its referred .properties file (a-ctx.xml and a.properties) as part of main program.
Second configuration file is owned by test class (b-ctx.xml).
I can't change main program configuration for test and test class need some properties too.
What is solution now?
Feb 13th, 2011, 10:50 AM
When PropertyPlaceholderConfigurer completes resolving the placeholders, it throws an exception if there are any unresolved placeholders left.
You can avoid that behavior by setting ignore-unresolvable attribute of property-placeholder tag to true.
Feb 15th, 2011, 03:10 AM
Hi I wrote test programme I do not have any problem can you please post you junit test code and xml files.
Tags for this Thread