Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

context:property-placeholder not working for multiple files

I have got 2 properties file with me. I have mentioned both the files in the context:property-placeholder like this...

<context:property-placeholder location="conf/ConfServer.conf,conf/LicenseSettings.properties" />

Also I have tried this

<context:property-placeholder location="conf/ConfServer.conf,conf/LicenseSettings.properties" />

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations">
        <list>
            <value>conf/LicenseSettings.properties</value>
        </list>
    </property>
   <property name="ignoreUnresolvablePlaceholders" value="true"/>
</bean>

Both the above mentioned methods I have tried are not working.
Can anyone spot out the mistake and help me out of this?
I already referred to this, but it didn't work good for me.

like image 491
Freakyuser Avatar asked Jan 22 '13 10:01

Freakyuser


2 Answers

You can specify multiple context:property-placeholder tags within your configuration file. You can also specify which will be loaded first using the order attribute.

<context:property-placeholder location="conf/ConfServer.conf" order="1" ignore-unresolvable="true" />
<context:property-placeholder location="conf/LicenseSettings.properties" order="2" ignore-unresolvable="true" />
like image 117
Kevin Bowersox Avatar answered Sep 26 '22 15:09

Kevin Bowersox


Can you try referring these properties from project root directory

conf/ConfServer.conf

conf/LicenseSettings.properties

These may not be referred correctly.

like image 23
brownfox Avatar answered Sep 27 '22 15:09

brownfox