title: Maven Project: Spring cannot find property file inside src/main/resources using PropertyPlaceholderConfigurer
body: <p>Spring cant find my property file (MyPropFile.properties) inside src/main/resources and throws an exception like below</p>
  
  <pre><code>java.io.FileNotFoundException: class path resource [file*:/src/main/resources/MyPropFile.properties] cannot be opened because it does not exist
  </code></pre>
  
  <p>But if I place MyPropFile.properties at the root of my project (MyProject/MyPropFile.properties)  spring can find it and the programs executes properly.</p>
  
  <p>How do I configure this so that I can place my .properties file inside src/main/resources</p>
  
  <p>this is my namespace</p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
      xmlns:context="http://www.springframework.org/schema/context"
      xsi:schemaLocation="http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
      http://www.springframework.org/schema/aop 
      http://www.springframework.org/schema/aop/spring-aop-3.0.xsd 
      http://www.springframework.org/schema/context
   http://www.springframework.org/schema/context/spring-context-3.0.xsd
      "&gt;
  </code></pre>
  
  <p>this is my bean</p>
  
  <pre><code>&lt;context:property-placeholder location="classpath:MyPropFile.properties" /&gt;
  </code></pre>
  
  <p>Java:</p>
  
  <pre><code>@Value("${message.fromfile}")
        private String message;
  </code></pre>
  
  <p>Thanks in advance guys.</p>