Announcement Announcement Module
Collapse
No announcement yet.
org.xml.sax.SAXParseException: src-import.0: Failed to read imported schema document Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • org.xml.sax.SAXParseException: src-import.0: Failed to read imported schema document

    Hi, I have an issue with warnings in my AbstractAnnotationAwareTransactionalTests during intializations of the contexts. I can produce this issue with a single empty context like so:

    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:p="http://www.springframework.org/schema/p"
           xmlns:aop="http://www.springframework.org/schema/aop"
           xmlns:tx="http://www.springframework.org/schema/tx"
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
    
    <!-- bean definitions removed -->
    
    </beans>
    Here is an example warning as logged;

    Code:
    [2009-02-14 19:40:28,085] WARN  org.springframework.beans.factory.xml.XmlBeanDefinitionReader Ignored XML validation warning 
    org.xml.sax.SAXParseException: src-import.0: Failed to read imported schema document 'null'.
    	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:232)
    	at org.apache.xerces.util.ErrorHandlerWrapper.warning(ErrorHandlerWrapper.java:141)
    r(XMLErrorReporter.java:358)
    	at org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaWarning(XSDHandler.java:1837)
    	at org.apache.xerces.impl.xs.traversers.XSDHandler.getSchema(XSDHandler.java:1298)
    	at org.apache.xerces.impl.xs.traversers.XSDHandler.getSchema(XSDHandler.java:1240)
    	at org.apache.xerces.impl.xs.traversers.XSDHandler.constructTrees(XSDHandler.java:611)
    	at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:403)
    	at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:381)
    	at org.apache.xerces.impl.xs.XMLSchemaValidator.parseSchema(XMLSchemaValidator.java:2250)
    	at org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(XMLSchemaValidator.java:2178)
    	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1724)
    	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:568)
    	at org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(XMLNamespaceBinder.java:832)
    	at org.apache.xerces.impl.XMLNamespaceBinder.startElement(XMLNamespaceBinder.java:568)
    	at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:796)
    	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:752)
    	at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(XMLDocumentScannerImpl.java:927)
    	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1519)
    	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:333)
    	at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:529)
    	at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:585)
    	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147)
    	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:221)
    	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:201)
    	at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
    	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.test.AbstractSingleSpringContextTests.createApplicationContext(AbstractSingleSpringContextTests.java:212)
    	at org.springframework.test.AbstractSingleSpringContextTests.loadContextLocations(AbstractSingleSpringContextTests.java:189)
    	at org.springframework.test.AbstractSingleSpringContextTests.loadContext(AbstractSingleSpringContextTests.java:169)
    	at org.springframework.test.AbstractSpringContextTests.getContext(AbstractSpringContextTests.java:140)
    	at org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSingleSpringContextTests.java:98)
    	at junit.framework.TestCase.runBare(TestCase.java:128)
    	at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:76)
    	at org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.access$001(AbstractAnnotationAwareTransactionalTests.java:71)
    	at org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests$1.run(AbstractAnnotationAwareTransactionalTests.java:175)
    	at org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.runTest(AbstractAnnotationAwareTransactionalTests.java:283)
    	at org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.runTestTimed(AbstractAnnotationAwareTransactionalTests.java:254)
    	at org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.runBare(AbstractAnnotationAwareTransactionalTests.java:172)
    	at junit.framework.TestResult$1.protect(TestResult.java:110)
    	at junit.framework.TestResult.runProtected(TestResult.java:128)
    	at junit.framework.TestResult.run(TestResult.java:113)
    	at junit.framework.TestCase.run(TestCase.java:120)
    	at junit.framework.TestSuite.runTest(TestSuite.java:228)
    	at junit.framework.TestSuite.run(TestSuite.java:223)
    	at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
    	at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:32)
    	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:420)
    	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:911)
    	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:768)
    I get more than this, but they are all very much like this one.

    If I remove all the namespace declarations, I do not get the warnings. Any help would be appreciated.

  • #2
    Is this a Spring Bug or a SAX bug?

    It seems like this SAXParseException warning is generated just because of the namespace definitions in the spring context. There were automatically generated by NetBeans 6.5. If they are removed, then there are no warnings. However, all the namespace definitions look correct and I can load all the files they specify from my browser. Do other folks get this warning is they show WARN level logging?

    Code:
    [2009-02-14 19:40:28,085] WARN  org.springframework.beans.factory.xml.XmlBeanDefinitionReader Ignored XML validation warning 
    org.xml.sax.SAXParseException: src-import.0: Failed to read imported schema document 'null'.

    Comment

    Working...
    X