ClassPathResource.getInputStream() has thrown a FileNotFoundException

java.io.FileNotFoundException
at org.springframework.core.io.ClassPathResource.getInputStream
(Source)

Typical Exception Messages

  1. class path resource [applicationContext.xml] cannot be opened because it does not exist
  2. class path resource [Beans.xml] cannot be opened because it does not exist
  3. class path resource [beans.xml] cannot be opened because it does not exist
  4. class path resource [org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.class] cannot be opened because it does not exist
  5. class path resource [spring-servlet.xml] cannot be opened because it does not exist
  6. class path resource [WEB-INF/applicationContext.xml] cannot be opened because it does not exist
  7. class path resource [META-INF/cxf/cxf.xml] cannot be opened because it does not exist
  8. class path resource [cas.properties] cannot be opened because it does not exist
  9. class path resource [test/test/applicationContext.xml] cannot be opened because it does not exist
  10. class path resource [org/springframework/security/config/annotation/authentication/configurers/GlobalAuthenticationConfigurerAdapter.class] cannot be opened because it does not exist

Specific cases

We have seen this error pattern in the following webpages (455)

  1. Could not load properties; nested exception is java.io.FileNotFoundException: class path resource [pointsconfig.properties] cannot be opened because it does not exist
  2. IOException parsing XML document from class path resource [SpringProgram1/Beans.xml]; nested exception is java.io.FileNotFoundException: class path resource [SpringProgram1/Beans.xml] cannot be opened because it does not exist
  3. Failed to process import candidates for configuration class [com.my.sso.server.AuthServerConfig]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/security/config/annotation/authentication/configurers/GlobalAuthenticationConfigurerAdapter.class] cannot be opened because it does not exist
  4. IOException parsing XML document from class path resource [beans.xml]; nested exception is java.io.FileNotFoundException: class path resource [beans.xml] cannot be opened because it does not exist The console output is as follows:(excerpt) SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [beans.xml]; nested exception is java.io.FileNotFoundException: class path resource [beans.xml] cannot be opened because it does not exist
  5. Failed to parse configuration class [com.drg.AppConfig.SecurityConfiguration]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurerAdapter.class] cannot be opened because it does not exist
  6. Vaibhavvia Stack Overflow1 month ago
    java.lang.reflect.InvocationTargetException
  7. IOException parsing XML document from class path resource [applicationContext.xml]; nested exception is java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be opened because it does not exist
  8. Yakivvia Stack Overflow1 month ago
    Failed to parse configuration class [com.my.app.BatchJobsStarter]; nested exception is java.io.FileNotFoundException: class path resource [dataload.properties] cannot be opened because it does not exist
  9. Could not load properties; nested exception is java.io.FileNotFoundException: class path resource [classpath*:META-INF/db.properties] cannot be opened because it does not exist