Announcement Announcement Module
No announcement yet.
multiple configuration files causes problem in property-placeholder Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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 and

    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?

  • #2
    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 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?


    • #3
      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.


      • #4
        Hi I wrote test programme I do not have any problem can you please post you junit test code and xml files.