Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-6428

Placeholders not resolved when using multiple PropertyPlaceHolderConfigurers

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Works as Designed
    • Affects Version/s: 2.5.6
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      When using 2 PropertyPlaceHolderConfigurers, placeholders declared (and given a value) in the first PPC are not resolved in the second PPC.

      <bean id="configurer1" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
      <property name="properties">
      <bean class="java.util.Properties">
      <constructor-arg>
      <map>
      <entry key="resourceDirPlaceHolder">
      <value>myResourceDir</value>
      </entry>
      </map>
      </constructor-arg>
      </bean>
      </property>
      <property name="order" value="1"/>
      <property name="ignoreUnresolvablePlaceholders" value="true"/>
      </bean>

      <bean id="configurer2" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
      <property name="locations">
      <list>
      <value>classpath:${resourceDirPlaceHolder}/props.properties</value>
      </list>
      </property>
      </bean>

      this configuration results in:

      java.io.FileNotFoundException: class path resource [${resourceDirPlaceHolder}/props.properties] cannot be opened because it does not exist

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                cbeams Chris Beams
                Reporter:
                gizit Gisbert van Rossum
                Last updater:
                Trevor Marshall
              • Votes:
                2 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  6 years, 43 weeks, 3 days ago

                  Time Tracking

                  Estimated:
                  Original Estimate - 0.5d
                  0.5d
                  Remaining:
                  Remaining Estimate - 0.5d
                  0.5d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified