class path resource cannot be opened because it does not exist




Asked on April 23, 2013
Hi All,

I am new to spring and stuck with the error. I reading an external property file for database properties.

Caused by: java.io.FileNotFoundException: class path resource cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:158)
at org.springframework.core.io.support.PropertiesLoaderSupport.loadProperties(PropertiesLoaderSupport.java:181)
at org.springframework.core.io.support.PropertiesLoaderSupport.mergeProperties(PropertiesLoaderSupport.java:161)
at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:78)
... 6 more




Replied on April 23, 2013
Hi Ria,
The error may be because of

1.  There is no property file in classpath.
2.  You have misspelled the file name.


Check at your end.


Write Answer










©2024 concretepage.com | Privacy Policy | Contact Us