Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: File location for PropertyOverrideConfigurer

  1. #11
    Join Date
    Dec 2004
    Location
    Rotterdam, The Netherlands
    Posts
    162

    Default

    I am using the ClasspathXmlAppContext.

    The ${} syntax if for the PropertyPlaceHolderConfigurer.
    Kees de Kooter
    www.boplicity.net

  2. #12
    Join Date
    Dec 2004
    Location
    Rotterdam, The Netherlands
    Posts
    162

    Default

    Thanks Andreas,

    I start the app with -jar, from the folder the jar is in.
    Kees de Kooter
    www.boplicity.net

  3. #13
    Join Date
    Dec 2004
    Location
    Rotterdam, The Netherlands
    Posts
    162

    Default

    Did some more digging. I created a bare bones app with the following config:
    Code:
        <bean id="propertyOverrideConfigurer"
            class="org.springframework.beans.factory.config.PropertyOverrideConfigurer">
            <property name="location" value="file:deploy.properties"/>
            <property name="ignoreResourceNotFound"    value="false"/>
            <property name="ignoreInvalidKeys" value="false"/>
        </bean>
    
        <bean id="bean"
            class="Bean">
            <property name="property" value="original" />
        </bean>
    I would expect some error when the properties file is not found. But I see no error message at all. So apparently the override configurer is just not working.

    Then I read the spring reference guid once more on the subject:

    Just as in the case of BeanPostProcessors, you typically don't want to have
    BeanFactoryPostProcessors marked as being lazily-initialized.
    And that was exactly my problem My app context has the property default-lazy-init="true".
    After defining the configurer as lazy-init="false" everything worked as expected.
    Last edited by Kees de Kooter; Jul 17th, 2006 at 05:06 AM.
    Kees de Kooter
    www.boplicity.net

  4. #14
    Join Date
    May 2006
    Location
    Crawley, UK
    Posts
    105

    Default

    Quote Originally Posted by Kees de Kooter
    I am using the ClasspathXmlAppContext.

    The ${} syntax if for the PropertyPlaceHolderConfigurer.
    My apologies - I misread PropertyOverrideConfigurer as PropertyPlaceHolderConfigurer.
    If you didn't learn anything today, you weren't paying attention!

  5. #15
    Join Date
    Dec 2004
    Location
    Rotterdam, The Netherlands
    Posts
    162

    Default

    No problem. Thanks for your help.
    Kees de Kooter
    www.boplicity.net

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •