title: Spring PropertyOverrideConfigurer not overriding PropertyPlaceholderConfigurer?
body: <p>I have a Spring 4.0 application in which I use a property placeholder for default bean values, and property-override for overriding in these values in production environment. The code looks like this:</p>
  
  <pre><code>&lt;context:property-placeholder location="classpath:config.properties" /&gt;
  &lt;context:property-override ignore-resource-not-found="true" ignore-unresolvable="true" location="file:${config.file}" /&gt;
  </code></pre>
  
  <p>So in the production enviroment, you pass the parameter -Dconfig.file=path/to/config/file.properties on Tomcat startup to override these values. Example:</p>
  
  <p>Placeholder file:</p>
  
  <pre><code>dataSource.url=jdbc:sqlserver://10.46.1.1;database=TESTDB
  dataSource.user=mvdb
  dataSource.password=xxx
  </code></pre>
  
  <p>Production file:</p>
  
  <pre><code>dataSource.url=jdbc:sqlserver://10.77.10.14:1433;database=DB
  dataSource.user=mvdb
  dataSource.password=xxx
  </code></pre>
  
  <p>and the bean is defined as:</p>
  
  <pre><code>&lt;bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"&gt;
      &lt;property name="driverClass" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/&gt;
      &lt;property name="jdbcUrl" value="${dataSource.url}"/&gt;
      &lt;property name="user" value="${dataSource.user}"/&gt;
      &lt;property name="password" value="${dataSource.password}"/&gt;    
      (more properties omitted)
  &lt;/bean&gt;
  </code></pre>
  
  <p>However, these values are not getting overridden with the overriden file! I can see in the startup that both files gets loaded: </p>
  
  <pre><code>[2015-07-14 10:37:57:057 CEST]  INFO  support.PropertySourcesPlaceholderConfigurer: Loading properties file from class path resource [config.properties]
  [2015-07-14 10:37:58:058 CEST]  INFO  config.PropertyOverrideConfigurer: Loading properties file from URL [file:C:/var/opt/config/config.properties]
  </code></pre>
  
  <p>But it still uses the values from the placeholder classpath file and tries to connect to the test database. </p>
  
  <p>Any ideas?</p>