Announcement Announcement Module
Collapse
No announcement yet.
CastorMarshaller Mapping File Issue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • CastorMarshaller Mapping File Issue

    Sorry if I have posted this in the wrong project.

    I am using org.springframework.oxm.castor.CastorMarshaller to inject my mapping location and receiving a 'Stream closed' error. Any thoughts or direction would be appreciated. Thanks.


    Here is my applicationContext-castor.xml

    Code:
    <bean id="castorMarshaller" class="org.springframework.oxm.castor.CastorMarshaller">
    	 	<property name="mappingLocation" value="com/td/ods/test/ws/applicationContext-castor.xml" />
     	</bean>
    
        <bean id="castorXmlHelper" class="com.td.ods.util.xml.CastorXmlHelper">
           <property name="marshaller" ref="castorMarshaller" />
           <property name="unmarshaller" ref="castorMarshaller" />
        </bean>
    Here is the error:

    Code:
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'castorMarshaller' defined in class path resource [com/td/ods/test/ws/applicationContext-castor.xml]: Initialization of bean failed; nested exception is org.springframework.oxm.castor.CastorSystemException: Could not load Castor mapping: Nested error: Stream closed; nested exception is org.exolab.castor.mapping.MappingException: Nested error: Stream closed
    org.springframework.oxm.castor.CastorSystemException: Could not load Castor mapping: Nested error: Stream closed; nested exception is org.exolab.castor.mapping.MappingException: Nested error: Stream closed
    Stream closed
    	at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:717)
    	at org.castor.mapping.MappingUnmarshaller.loadMappingInternal(MappingUnmarshaller.java:203)
    	at org.castor.mapping.MappingUnmarshaller.getMappingLoader(MappingUnmarshaller.java:124)
    	at org.castor.mapping.MappingUnmarshaller.getMappingLoader(MappingUnmarshaller.java:99)
    	at org.exolab.castor.xml.Unmarshaller.setMapping(Unmarshaller.java:483)
    	at org.exolab.castor.xml.Unmarshaller.<init>(Unmarshaller.java:249)
    	at org.springframework.oxm.castor.CastorMarshaller.afterPropertiesSet(CastorMarshaller.java:141)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1091)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:396)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:283)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:87)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:72)
    	at org.springframework.test.AbstractSpringContextTests.loadContextLocations(AbstractSpringContextTests.java:135)
    	at org.springframework.test.AbstractDependencyInjectionSpringContextTests.loadContextLocations(AbstractDependencyInjectionSpringContextTests.java:224)
    	at org.springframework.test.AbstractSpringContextTests.getContext(AbstractSpringContextTests.java:115)
    	at org.springframework.test.AbstractDependencyInjectionSpringContextTests.setUp(AbstractDependencyInjectionSpringContextTests.java:192)
    	at junit.framework.TestCase.runBare(TestCase.java:125)
    	at junit.framework.TestResult$1.protect(TestResult.java:106)
    	at junit.framework.TestResult.runProtected(TestResult.java:124)
    	at junit.framework.TestResult.run(TestResult.java:109)
    	at junit.framework.TestCase.run(TestCase.java:118)
    	at junit.framework.TestSuite.runTest(TestSuite.java:208)
    	at junit.framework.TestSuite.run(TestSuite.java:203)
    	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
    	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    Caused by: java.io.IOException: Stream closed
    	at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:145)
    	at java.io.BufferedInputStream.read(BufferedInputStream.java:304)
    	at org.apache.xerces.utils.ChunkyByteArray.fill(ChunkyByteArray.java:222)
    	at org.apache.xerces.utils.ChunkyByteArray.<init>(ChunkyByteArray.java:98)
    	at org.apache.xerces.readers.DefaultReaderFactory.createReader(DefaultReaderFactory.java:153)
    	at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocument(DefaultEntityHandler.java:491)
    	at org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:310)
    	at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1034)
    	at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:708)
    	... 31 more
    Caused by: java.io.IOException: Stream closed
    	at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:145)
    	at java.io.BufferedInputStream.read(BufferedInputStream.java:304)
    	at org.apache.xerces.utils.ChunkyByteArray.fill(ChunkyByteArray.java:222)
    	at org.apache.xerces.utils.ChunkyByteArray.<init>(ChunkyByteArray.java:98)
    	at org.apache.xerces.readers.DefaultReaderFactory.createReader(DefaultReaderFactory.java:153)
    	at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocument(DefaultEntityHandler.java:491)
    	at org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:310)
    	at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1034)
    	at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:708)
    	at org.castor.mapping.MappingUnmarshaller.loadMappingInternal(MappingUnmarshaller.java:203)
    	at org.castor.mapping.MappingUnmarshaller.getMappingLoader(MappingUnmarshaller.java:124)
    	at org.castor.mapping.MappingUnmarshaller.getMappingLoader(MappingUnmarshaller.java:99)
    	at org.exolab.castor.xml.Unmarshaller.setMapping(Unmarshaller.java:483)
    	at org.exolab.castor.xml.Unmarshaller.<init>(Unmarshaller.java:249)
    	at org.springframework.oxm.castor.CastorMarshaller.afterPropertiesSet(CastorMarshaller.java:141)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1091)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:396)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:283)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:87)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:72)
    	at org.springframework.test.AbstractSpringContextTests.loadContextLocations(AbstractSpringContextTests.java:135)
    	at org.springframework.test.AbstractDependencyInjectionSpringContextTests.loadContextLocations(AbstractDependencyInjectionSpringContextTests.java:224)
    	at org.springframework.test.AbstractSpringContextTests.getContext(AbstractSpringContextTests.java:115)
    	at org.springframework.test.AbstractDependencyInjectionSpringContextTests.setUp(AbstractDependencyInjectionSpringContextTests.java:192)
    	at junit.framework.TestCase.runBare(TestCase.java:125)
    	at junit.framework.TestResult$1.protect(TestResult.java:106)
    	at junit.framework.TestResult.runProtected(TestResult.java:124)
    	at junit.framework.TestResult.run(TestResult.java:109)
    	at junit.framework.TestCase.run(TestCase.java:118)
    	at junit.framework.TestSuite.runTest(TestSuite.java:208)
    	at junit.framework.TestSuite.run(TestSuite.java:203)
    	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
    	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    Mapping file is empty:
    Code:
    <?xml version="1.0"?>
    <mapping>
       <description>Castor mapping all classes</description>
    
    </mapping>

  • #2
    Sounds like could be having the same problems as discussed in this thread. The issue has been resolved in subversion, which means you can use a nighly snapshot to get a fix.

    Let me know if that works for you.

    Comment

    Working...
    X