title: spring external properties file; file not found exception
body: <p>I am trying to read from an external properties file with the following code below. I am pretty sure I have the path set up correctly but I am still getting the file not found error. Any suggestions? Here is my code:</p>
  
  <pre><code>public class Timer {
  
       @Autowired
        private ApplicationContext ctx;
  
       @Autowired
          private SpringMailSender springMailSender;
  
      @Scheduled(cron="${timer.time}") //this is the line that is having trouble
      public void timer()
      {
          System.out.println("timer() in Timer Class has been stepped into");
          try {
              springMailSender.sendMail();
              } catch (Exception e) {
                  e.printStackTrace();
              }
          System.out.println("Method executed on every 2nd Monday of each month. Current time is :: "+ new Date());
      }
  
  }
  </code></pre>
  
  <p>And here is how I have my config file set up for it...</p>
  
  <pre><code>&lt;!--  Property Placeholder --&gt;
          &lt;bean
              class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;
              &lt;property name="locations"&gt;
                  &lt;list&gt;
                      &lt;value&gt;classpath:properties/system.properties&lt;/value&gt;
                      &lt;value&gt;file:${external.property.directory}propfilename&lt;/value&gt;
                  &lt;/list&gt;
              &lt;/property&gt;
          &lt;/bean&gt;
  
  &lt;!-- messageSource --&gt;
      &lt;bean id="messageSource"
          class="org.springframework.context.support.ReloadableResourceBundleMessageSource"&gt;
          &lt;property name="basenames"&gt;
              &lt;list&gt;
                  &lt;value&gt;file:${external.property.directory}propfilename&lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>With my external file path set up like this in the properties file within the web app.</p>
  
  <pre><code>#directory on the server where property files will be stored
  external.property.directory=C\:\\propfoldername\\
  </code></pre>
  
  <p>And the error I'm getting is this:</p>
  
  <pre><code> org.springframework.beans.factory.BeanInitializationException: Could not load properties; nested exception is java.io.FileNotFoundException: ${external.property.directory}propfilename (The system cannot find the file specified)
  </code></pre>
  
  <p>Any help would be appreciated. Let me know if I left out some code you might need to see.</p>