Announcement Announcement Module
Collapse
No announcement yet.
Spring 3.0 org.xml.sax.SAXParseException Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring 3.0 org.xml.sax.SAXParseException

    Hi,

    i googled and searched the forum, but i could not find any solution. I found some posts with the same Exception, but the problem in almost all of them was, that the spring version in application-context.xml and the spring version of the jar files in the classpath were different. That is not the case for my problem.

    Im developing a standalone jar application. In eclipse my application is running without any problems, but when i try to execute the jar file i get this Exception:

    Code:
    2012-06-08 15:57:04,532 INFO  [CollectionFactory.java:71] : Commons Collections 3.x available
    2012-06-08 15:57:04,550 INFO  [XmlBeanDefinitionReader.java:163] : Loading XML bean definitions from class path resource [application-context.xml]
    Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Line 10 in XML document from class path resource [application-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE root "null".
    org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE root "null".
            at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
            at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
            at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
            at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
            at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.rootElementSpecified(Unknown Source)
            at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)
            at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
            at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
            at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$ContentDriver.scanRootElementHook(Unknown Source)
            at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
            at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
            at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
            at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
            at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
            at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
            at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
            at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
            at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:222)
            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:173)
            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:148)
            at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:129)
            at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:145)
            at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:113)
            at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:81)
            at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89)
            at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:262)
            at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:87)
            at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:72)
            at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:63)
            at at.sozvers.itsv.App.main(App.java:45)
    application-context.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
    	xmlns:context="http://www.springframework.org/schema/context"
    	xsi:schemaLocation="
         http://www.springframework.org/schema/beans 
         http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
         http://www.springframework.org/schema/tx 
         http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
         http://www.springframework.org/schema/context
         http://www.springframework.org/schema/context/spring-context-3.0.xsd">
    ......
    </beans>
    MANIFEST:
    Code:
    Manifest-Version: 1.0
    Archiver-Version: Plexus Archiver
    Created-By: Apache Maven
    Built-By: eds
    Build-Jdk: 1.6.0
    Main-Class: at.sozvers.itsv.App
    Class-Path: dependency/jaxb2-basics-0.6.3.jar dependency/jaxb2-basics-
     runtime-0.6.3.jar dependency/jaxb2-basics-tools-0.6.3.jar dependency/
     commons-beanutils-1.7.0.jar dependency/commons-logging-1.1.1.jar depe
     ndency/commons-lang-2.2.jar dependency/commons-cli-1.2.jar dependency
     /jaxb-api-2.1.jar dependency/stax-api-1.0-2.jar dependency/activation
     -1.1.jar dependency/jaxb-impl-2.1.3.jar dependency/spring-core-3.0.0.
     RELEASE.jar dependency/spring-asm-3.0.0.RELEASE.jar dependency/spring
     -expression-3.0.0.RELEASE.jar dependency/spring-beans-3.0.0.RELEASE.j
     ar dependency/spring-context-3.0.0.RELEASE.jar dependency/spring-cont
     ext-support-3.0.0.RELEASE.jar dependency/spring-aop-3.0.0.RELEASE.jar
      dependency/aopalliance-1.0.jar dependency/spring-jdbc-3.0.0.RELEASE.
     jar dependency/spring-tx-3.0.0.RELEASE.jar dependency/cglib-nodep-2.2
     .jar dependency/ojdbc6-11.1.0.7.0.jar dependency/log4j-1.2.16.jar
    Files in dependency folder:
    08.06.2012 15:56 322.362 cglib-nodep-2.2.jar
    08.06.2012 15:56 41.123 commons-cli-1.2.jar
    08.06.2012 15:56 89.967 jaxb-api-2.1.jar
    08.06.2012 15:56 843.569 jaxb-impl-2.1.3.jar
    08.06.2012 15:56 70.250 jaxb2-basics-0.6.3.jar
    08.06.2012 15:56 481.535 log4j-1.2.16.jar
    08.06.2012 15:56 1.988.051 ojdbc6-11.1.0.7.0.jar
    08.06.2012 15:56 324.242 spring-aop-3.0.0.RELEASE.jar
    08.06.2012 15:56 551.967 spring-beans-3.0.0.RELEASE.jar
    08.06.2012 15:56 657.492 spring-context-3.0.0.RELEASE.jar
    08.06.2012 15:56 101.176 spring-context-support-3.0.0.RELEASE.jar
    08.06.2012 15:56 359.338 spring-core-3.0.0.RELEASE.jar
    08.06.2012 15:56 154.200 spring-expression-3.0.0.RELEASE.jar
    08.06.2012 15:56 381.893 spring-jdbc-3.0.0.RELEASE.jar


    IBM Java Version
    :
    java version "1.6.0_13"
    Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
    Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02, mixed mode)

    Hopefully someone can help me

    best regards

    3d45t3r

  • #2
    solved the problem. I was using the pre-installed windows java version. I set the right java_home variable in my path and everything worked

    Comment

    Working...
    X