title: Not able to inject .properties file into Spring MVC 4.3 using @PropertySource
body: <p>I want to use <code>.properties</code> file to read mysql and hibernate properties using <code>Environment</code> and <code>@PropertySources</code> but I am getting error below</p>
  
  <blockquote>
    <p>java.io.FileNotFoundException: class path resource [ /com/properties/persistence/mysqldb.properties] cannot be opened because it does not exist</p>
  </blockquote>
  
  <p>Here is my project strutucture</p>
  
  <p><a href="https://i.stack.imgur.com/9v6Kl.jpg" rel="nofollow"><img src="https://i.stack.imgur.com/9v6Kl.jpg" alt="enter image description here"></a></p>
  
  <p>PersistenceConfig.java</p>
  
  <pre><code>@Configuration
  @EnableJpaRepositories(basePackages="com.hp.model.repository")
  @EnableTransactionManagement
  @PropertySources({
  @PropertySource("classpath: /com/properties/persistence/mysqldb.properties"),
  @PropertySource("classpath: /com/properties/persistence/hibernate.properties")})
  public class PersistenceConfig {
  
  @Autowired
  Environment env;
  .......
  </code></pre>
  
  <p>I have checked my build path and <code>src/main/resources</code> is on the classpath as shown below</p>
  
  <p><a href="https://i.stack.imgur.com/I1Zy6.jpg" rel="nofollow"><img src="https://i.stack.imgur.com/I1Zy6.jpg" alt="enter image description here"></a></p>
  
  <p>Any clue what I am missing ?</p>