Announcement Announcement Module
Collapse
No announcement yet.
IOException parsing xml file Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • IOException parsing xml file

    Hi,

    New to springs finding difficult to understand and debug error messages.

    Jun 7, 2010 6:19:26 AM org.springframework.context.support.AbstractApplic ationContext prepareRefresh
    INFO: Refreshing org.springframework.context.support.ClassPathXmlAp plicationContext@758fc9: display name [org.springframework.context.support.ClassPathXmlAp plicationContext@758fc9]; startup date [Mon Jun 07 06:19:26 IST 2010]; root of context hierarchy
    Jun 7, 2010 6:19:27 AM org.springframework.beans.factory.xml.XmlBeanDefin itionReader loadBeanDefinitions
    INFO: Loading XML bean definitions from class path resource [com/springinaction/springidol/spring-idol.xml]
    Exception in thread "main" org.springframework.beans.factory.BeanDefinitionSt oreException: IOException parsing XML document from class path resource [com/springinaction/springidol/spring-idol.xml]; nested exception is java.io.FileNotFoundException: class path resource [com/springinaction/springidol/spring-idol.xml] cannot be opened because it does not exist
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:349)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:310)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:143)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:178)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:149)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:212)
    at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:113)
    at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:80)
    at org.springframework.context.support.AbstractRefres hableApplicationContext.refreshBeanFactory(Abstrac tRefreshableApplicationContext.java:123)
    at org.springframework.context.support.AbstractApplic ationContext.obtainFreshBeanFactory(AbstractApplic ationContext.java:422)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:352)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:139)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:83)
    at com.springinaction.springidol.competitionmain.main (competitionmain.java:14)
    Caused by: java.io.FileNotFoundException: class path resource [com/springinaction/springidol/spring-idol.xml] cannot be opened because it does not exist
    at org.springframework.core.io.ClassPathResource.getI nputStream(ClassPathResource.java:143)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:336)
    ... 13 more

    Source code in attachment

    Regards,
    Manjunatha V

  • #2
    As the exception says..its not able to find the xml file com/springinaction/springidol/spring-idol.xml. Where is that file located?

    Comment


    • #3
      Hi,

      Please find the classpath from the attached doc, com/springinaction/springidol/spring-idol.xml is where file is present

      Regards.
      Manju V

      Comment


      • #4
        Hi,
        I executed your code without errors.
        Maybe your configuration in eclipse is not copying the file "spring-idol.xml" in the target directory.
        Please check if this file is on the target directory.
        Regards

        Comment


        • #5
          Hi,

          spring-idol.xml is present in src folder and in the specified path com/springinaction/springidol/spring-idol.xml.

          What is the configuration to be changed in eclipse.

          Regards,
          Manju V

          Comment


          • #6
            Hi,
            I don't use Eclipse, so I cannot help you in the configuration.
            Try to copy manually the file "spring-idol.xml" to the output directory, I mean to the "com/springinaction/springidol" but that contains the .class files.

            Comment


            • #7
              It works once i copy spring-idol xml file to bin directory com/springinaction/springidol/spring-idol.xml

              Comment

              Working...
              X