Issue with application.properties file in java
<p>I am trying to fetch the database values from properties, so for the same reason I am using @PropertySource in spring, but it is throwing the FileNotFoundException</p>

<pre><code>@Configuration
@EnableJpaRepositories(basePackages = {
        "com.manju.springdata.repository"
})
@EnableTransactionManagement
@EnableWebMvc
@ComponentScan(basePackages = "com.manju.springdata.*")
@PropertySource("classpath:/application.properties")
public class PersistenceContext {

    @Value("${db.driver}")
    private String dbDriver;

    @Value("${db.url}")
    private String dbURL;

    @Value("${db.username}")
    private String dbUserName;

    @Value("${db.password}")
    private String dbPassword;

    @Bean(destroyMethod = "close")
    DataSource dataSource(Environment env){
        BoneCPDataSource dataSource = new BoneCPDataSource();
        //dataSource.setDriverClass(env.getRequiredProperty("db.driver"));
        dataSource.setDriverClass(dbDriver);
        dataSource.setJdbcUrl(dbURL);
        dataSource.setUsername(dbUserName);
        dataSource.setPassword(dbPassword);
        return dataSource;
    }

    @Bean
    public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
            return new PropertySourcesPlaceholderConfigurer();
    }
    }
</code></pre>

<p>My project structure is as follows,</p>

<p><a href="https://i.stack.imgur.com/hQqWh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hQqWh.png" alt="enter image description here"></a> </p>

<p>I am getting the following error,</p>

<pre><code>Caused by: java.io.FileNotFoundException: class path resource [application.properties] cannot be opened because it does not exist
        at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:172) ~[spring-core-4.2.0.RELEASE.jar:4.2.0.RELEASE]
        at org.springframework.core.io.support.EncodedResource.getInputStream(EncodedResource.java:153) ~[spring-core-4.2.0.RELEASE.jar:4.2.0.RELEASE]
        at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:98) ~[spring-core-4.2.0.RELEASE.jar:4.2.0.RELEASE]
        at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:72) ~[spring-core-4.2.0.RELEASE.jar:4.2.0.RELEASE]
        at org.springframework.core.io.support.PropertiesLoaderUtils.loadProperties(PropertiesLoaderUtils.java:58) ~[spring-core-4.2.0.RELEASE.jar:4.2.0.RELEASE]
        at org.springframework.core.io.support.ResourcePropertySource.&lt;init&gt;(ResourcePropertySource.java:84) ~[spring-core-4.2.0.RELEASE.jar:4.2.0.RELEASE]
        at org.springframework.context.annotation.ConfigurationClassParser.processPropertySource(ConfigurationClassParser.java:360) ~[spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]
        at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:254) ~[spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]
        at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:231) ~[spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]
        at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:198) ~[spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]
        at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:167) ~[spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]
        ... 57 common frames omitted
</code></pre>

<p>How do I access my properties file values, what's wrong with my code? Any suggestions </p>