Announcement Announcement Module
Collapse
No announcement yet.
"Failed to import bean definitions from URL location [classpath:" Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • "Failed to import bean definitions from URL location [classpath:"

    Hi Guys,

    I am trying to run the samples that come with spring batch. Have tried running it in Eclipse, NetBeans and from command line (after setting all the classpaths) as is suggested on http://static.springframework.org/sp...g-started.html.

    However I am running into this error as below. After looking on the web it seems this is one of the way to specify to locate the resoures in spring and seems like a very simple problem to resolve. Could you please help in this matter as I have spent loads of time trying to resolve this issue. I am the most new bee on the spring/spring batch.

    Code:
    2009-03-25 12:21:43,296 DEBUG [main] org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader:Loading bean definitions
    2009-03-25 12:21:43,312 INFO  [main] org.springframework.beans.factory.xml.XmlBeanDefinitionReader:Loading XML bean definitions from class path resource [simple-job-launcher-context.xml]
    2009-03-25 12:21:43,312 ERROR [main] org.springframework.batch.core.launch.support.CommandLineJobRunner:Job Terminated in error:
    org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:/simple-job-launcher-context.xml]
    Offending resource: class path resource [test/resources/org/springframework/batch/sample/TradeJobFunctionalTests-context.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [simple-job-launcher-context.xml]; nested exception is java.io.FileNotFoundException: class path resource [simple-job-launcher-context.xml] cannot be opened because it does not exist
            at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
            at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
            at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76)
            at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:182)
            at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:147)
            at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:132)
            at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
            at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
            at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
            at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
            at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)
            at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:113)
            at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:80)
            at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
            at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
            at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
            at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
            at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
            at org.springframework.batch.core.launch.support.CommandLineJobRunner.start(CommandLineJobRunner.java:189)
            at org.springframework.batch.core.launch.support.CommandLineJobRunner.main(CommandLineJobRunner.java:251)
    Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [simple-job-launcher-context.xml]; nested exception is java.io.FileNotFoundException: class path resource [simple-job-launcher-context.xml] cannot be opened because it does not exist
            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349)
    Thanks in advance.

  • #2
    Yes, this is pretty basic stuff.

    Code:
    [simple-job-launcher-context.xml] cannot be opened because it does not exist
    Looks like you do not have that file in the root of your classpath?

    Comment

    Working...
    X