title: How do I load ${catalina.home}/conf/application.properties in a Spring / Tomcat webapp?
body: <p>How do I load <code>${catalina.home}/conf/application.properties</code> in a Spring / Tomcat webapp?</p>
  
  <p>Looking around on StackOverflow and Google I see many discussions which claim it's possible.  However, it's just not working for me. In line with the advice from my research my Spring <code>applicationContext.xml</code> file contains the following line:</p>
  
  <pre><code>&lt;context:property-placeholder location="${catalina.home}/conf/application.properties"/&gt;
  </code></pre>
  
  <p>But I get this in the logs:</p>
  
  <pre><code>Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/Users/username/Servers/apache-tomcat-6.0.36/conf/application.properties]
  </code></pre>
  
  <p>From the log entry I can see that <code>${catalina.home}</code> is expanding correctly. When I expand it by hand in the <code>applicationContext.xml</code> file it returns the same error. The following returns the contents of the application.properties file as expected:</p>
  
  <pre><code>cat /Users/username/Servers/apache-tomcat-6.0.36/conf/application.properties
  </code></pre>
  
  <p>So the path is clearly correct.  Is this a webapp security or Tomcat server configuration issue?</p>