Announcement Announcement Module
Collapse
No announcement yet.
propertyConfigurer issue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • propertyConfigurer issue

    Hi. I'm using spring 1.2.6 and 1.2.8 in a web environment and I have the following problem:

    I'm setting up in web.xml the following:

    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
    classpath:applicationContext-hibernate.xml
    classpath:a/b/c/d/applicationContext-hibernateRuntimeParams.xml
    </param-value>
    </context-param>

    In each of the two application xmls I have a propertyConfigurer which reads from different properties files. The problem is that when loading the second context file, I get the error that it cannot find the property indicated by a placeholder. If placing the applicationContext-hibernateRuntimeParams.xml first like this:

    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
    classpath:a/b/c/d/applicationContext-hibernateRuntimeParams.xml
    classpath:applicationContext-hibernate.xml
    </param-value>
    </context-param>

    The SECOND context will complain about not finding placeholders. It's like only the first placeholderConfigurer is loaded properly and the second will try to load from the same properties file but they are different as I said.

    Does anyone have an idea of what's going on ?

    The spring contexts are loaded by the classic org.springframework.web.context.ContextLoaderListe ner

    Thanks

  • #2
    Well by 1.2.6 and 1.2.8 I mean I'm getting the same behavior with both versions

    Comment


    • #3
      It's not possible to say from the information you gave. Do both xml files contain placeholders with the same name? If so then the first placeholder configurer to be instantiated is going to replace those values, which might end up looking like the second file is not read at all. One thing is clear from your example: the two xml files are part of the configuration for the same ApplicationContext, so their beans and their placeholder configurers are not independent. You can make them indepenent if you need to by changing the placeholder prefix and suffix (e.g. from ${,} to %{,}).

      Comment

      Working...
      X