Unable to locate bean definitions xml file

java.io.FileNotFoundException
Javadoc
at org.springframework.core.io.ClassPathResource.getInputStream
(source)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions
(source)

Typical Exception Messages

  1. Failed to load ApplicationContext
  2. 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
  3. <No message>
  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
  5. 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
  6. IOException parsing XML document from class path resource [spring.xml]; nested exception is java.io.FileNotFoundException: class path resource [spring.xml] cannot be opened because it does not exist
  7. class path resource [applicationContext.xml] cannot be opened because it does not exist
  8. IOException parsing XML document from class path resource [root/AirTicketingSystem/server-cache-config.xml]; nested exception is java.io.FileNotFoundException: class path resource [root/AirTicketingSystem/server-cache-config.xml] cannot be opened because it does not exist
  9. IOException parsing XML document from class path resource [META-INF/cxf/cxf-extension-soap.xml]; nested exception is java.io.FileNotFoundException: class path resource [META-INF/cxf/cxf-extension-soap.xml] cannot be opened because it does not exist
  10. IOException parsing XML document from class path resource [broker-config.xml]; nested exception is java.io.FileNotFoundException: class path resource [broker-config.xml] cannot be opened because it does not exist

Origin

ClassPathResource.getInputStream() has thrown a FileNotFoundException

java.io.FileNotFoundException
org.springframework.core.io.ClassPathResource.getInputStream
349Web pages
1Solution

Similar

Specific cases

Solution

rahsan, 4 months ago

There are a few possible solutions for this:

  • Check if you actually have the bean definitions xml file in your application.
  • Make sure that you have provided the relative path of the xml file while creating ApplicationContext, check this solution for more details

External results for this pattern (196)

  1. liyanxivia GitHub1 month ago
    IOException parsing XML document from class path resource [spring-context.xml]; nested exception is java.io.FileNotFoundException: class path resource [spring-context.xml] cannot be opened because it does not exist
    Show stack trace
  2. Unknown authorvia Google Groups1 month ago
    IOException parsing XML document from class path resource [spring/match-converter-context.xml]; nested exception is java.io.FileNotFoundException: class path resource [spring/match-converter-context.xml] cannot be opened because it does not exist
    Show stack trace
  3. solidersvia GitHub3 months ago
    IOException parsing XML document from class path resource [activiti.cfg.xml]; nested exception is java.io.FileNotFoundException: class path resource [activiti.cfg.xml] cannot be opened because it does not exist
    Show stack trace
  4. JiangChen123via GitHub3 months ago
    IOException parsing XML document from class path resource [ureport-core-context.xml]; nested exception is java.io.FileNotFoundException: class path resource [ureport-core-context.xml] cannot be opened because it does not exist
    Show stack trace
  5. IOException parsing XML document from class path resource [spring.xml]; nested exception is java.io.FileNotFoundException: class path resource [spring.xml] cannot be opened because it does not exist
    Show stack trace
  6. oshiryaevavia GitHub5 months ago
    IOException parsing XML document from class path resource [comcompanysales/web-spring.xml]; nested exception is java.io.FileNotFoundException: class path resource [comcompanysales/web-spring.xml] cannot be opened because it does not exist
    Show stack trace
  7. oshiryaevavia GitHub5 months ago
    IOException parsing XML document from class path resource [comcompany]; nested exception is java.io.FileNotFoundException: class path resource [comcompany] cannot be opened because it does not exist
    Show stack trace
  8. hamidvia Stack Overflow5 months ago
    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
    Show stack trace
  9. Cobra_Fastvia Stack Overflow5 months ago
    No message found for this stack trace.
    Show stack trace
  10. IOException parsing XML document from class path resource [com/jalaj/programming/testprog/beans1.xml]; nested exception is java.io.FileNotFoundException: class path resource [com/jalaj/programming/testprog/beans1.xml] cannot be opened because it does not exist
    Show stack trace