<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=gshanky" rel="nofollow">Gowrishankar V</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-5719?redirect=false" rel="nofollow">SPR-5719</a></strong> and commented</p>
<p dir="auto">In my webapp I have multiple PPC configured in different context files. The primary context file is initialized through ContextLoaderListener and others are imported into the primary context xml file.</p>
<p dir="auto">In the primary context file, I have a PPC, which is initializing. Then there are other PPC in context files that are in jars which are initialized through imports. The PPC in those context files are not being initialized. If I remove the PPC from the primary context file, then one of the other PPC is being initialized. From my meddling around the code, it seems like only one PPC would be initialized per Application context, with or without imported context xml files.</p>
<p dir="auto">Currently I am including all the files though the PPC in my primary context file.</p>
<p dir="auto">I am wondering if this is a bug or is this how it is supposed to work?</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.5.6</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398099799" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11094" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11094/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11094">#11094</a> Placeholders not resolved when using multiple PropertyPlaceHolderConfigurers (<em><strong>"duplicates"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398099799" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11094" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11094/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11094">#11094</a> Placeholders not resolved when using multiple PropertyPlaceHolderConfigurers</li>
</ul>
<p dir="auto">3 votes, 4 watchers</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=gizit" rel="nofollow">Gisbert van Rossum</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-6428?redirect=false" rel="nofollow">SPR-6428</a></strong> and commented</p>
<p dir="auto">When using 2 PropertyPlaceHolderConfigurers, placeholders declared (and given a value) in the first PPC are not resolved in the second PPC.</p>
<p dir="auto">&lt;bean id="configurer1" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;<br>
&lt;property name="properties"&gt;<br>
&lt;bean class="java.util.Properties"&gt;<br>
&lt;constructor-arg&gt;<br>
&lt;map&gt;<br>
&lt;entry key="resourceDirPlaceHolder"&gt;<br>
&lt;value&gt;myResourceDir&lt;/value&gt;<br>
&lt;/entry&gt;<br>
&lt;/map&gt;<br>
&lt;/constructor-arg&gt;<br>
&lt;/bean&gt;<br>
&lt;/property&gt;<br>
&lt;property name="order" value="1"/&gt;<br>
&lt;property name="ignoreUnresolvablePlaceholders" value="true"/&gt;<br>
&lt;/bean&gt;<br>
&lt;bean id="configurer2" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;<br>
&lt;property name="locations"&gt;<br>
&lt;list&gt;<br>
&lt;value&gt;classpath:${resourceDirPlaceHolder}/props.properties&lt;/value&gt;<br>
&lt;/list&gt;<br>
&lt;/property&gt;<br>
&lt;/bean&gt;</p>
<p dir="auto">this configuration results in:</p>
<p dir="auto">java.io.FileNotFoundException: class path resource [${resourceDirPlaceHolder}/props.properties] cannot be opened because it does not exist</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.5.6</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/15954/multiplePPCs.zip" rel="nofollow">multiplePPCs.zip</a> (<em>4.84 kB</em>)</li>
</ul>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398094795" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10389" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10389/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10389">#10389</a> only the first PropertyPlaceHolderConfigurer is initialized. Others are not (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398094795" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10389" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10389/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10389">#10389</a> only the first PropertyPlaceHolderConfigurer is initialized. Others are not</li>
</ul>
<p dir="auto"><strong>Referenced from:</strong> commits <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-attic/spring-framework-issues/commit/09aea36859bb0d806eb4085a2c154cb781bd8345/hovercard" href="https://github.com/spring-attic/spring-framework-issues/commit/09aea36859bb0d806eb4085a2c154cb781bd8345">spring-attic/spring-framework-issues@<tt>09aea36</tt></a></p>
<p dir="auto">2 votes, 2 watchers</p>