java.lang.UnsupportedOperationException: XStreamMarshaller does not support unmarshalling using SAX XMLReaders

Spring JIRA | cyril vid | 7 years ago
  1. 0

    I'm using Spring Batch 2.1.0.RELEASE with Spring 3.0.1.RELEASE with Jdk 1.5. Test 1 When I use the following environment : . Spring Batch 2.1.0.RELEASE . Spring WS 1.5.9 (modules spring-xml and spring-oxm) . Spring 2.5.6 Everything works fine. Test 2 When I use the following environment : . Spring Batch 2.1.0.RELEASE . Spring 3.1.0.RELEASE . and WITHOUT spring-oxm module from Spring WS (packages spring-xml and spring-oxm have been integrated into Spring since Spring 3). I got the UnsupportedOperationException error when runngin XmlFunctionalTests : Code: java.lang.UnsupportedOperationException: XStreamMarshaller does not support unmarshalling using SAX XMLReaders at org.springframework.oxm.xstream.XStreamMarshaller.unmarshalSaxReader(XStreamMarshaller.java:460) at org.springframework.oxm.support.AbstractMarshaller.unmarshalSaxSource(AbstractMarshaller.java:341) at org.springframework.oxm.support.AbstractMarshaller.unmarshal(AbstractMarshaller.java:131) at org.springframework.batch.item.xml.StaxEventItemReader.doRead(StaxEventItemReader.java:222) at org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader.read(AbstractItemCountingItemStreamItemReader.java:87) at org.springframework.batch.sample.iosample.AbstractIoSampleTests.getCredits(AbstractIoSampleTests.java:92) at org.springframework.batch.sample.iosample.AbstractIoSampleTests.testUpdateCredit(AbstractIoSampleTests.java:53) Test 3 When I use the following environment : . Spring Batch 2.1.0.RELEASE . Spring 3.1.0.RELEASE . and WITHOUT spring-oxm and spring-xml modules from Spring WS (packages spring-xml and spring-oxm have been integrated into Spring since Spring 3). I got the ClassNotFoundException error when runngin XmlFunctionalTests : Code: java.lang.ClassNotFoundException : org.springframework.xml.transform.StaxSource Diagnosis and possible solution This is due to the fact that Spring 3 renamed the package org.springframework.xml.transform from Spring WS 1.5.9 into org.springframework.util.xml. So you must change the code for StaxEventItemReader and StaxEventItemWriter in order for Spring Batch to work with Spring 3.

    Spring JIRA | 7 years ago | cyril vid
    java.lang.UnsupportedOperationException: XStreamMarshaller does not support unmarshalling using SAX XMLReaders
  2. 0

    I'm using Spring Batch 2.1.0.RELEASE with Spring 3.0.1.RELEASE with Jdk 1.5. Test 1 When I use the following environment : . Spring Batch 2.1.0.RELEASE . Spring WS 1.5.9 (modules spring-xml and spring-oxm) . Spring 2.5.6 Everything works fine. Test 2 When I use the following environment : . Spring Batch 2.1.0.RELEASE . Spring 3.1.0.RELEASE . and WITHOUT spring-oxm module from Spring WS (packages spring-xml and spring-oxm have been integrated into Spring since Spring 3). I got the UnsupportedOperationException error when runngin XmlFunctionalTests : Code: java.lang.UnsupportedOperationException: XStreamMarshaller does not support unmarshalling using SAX XMLReaders at org.springframework.oxm.xstream.XStreamMarshaller.unmarshalSaxReader(XStreamMarshaller.java:460) at org.springframework.oxm.support.AbstractMarshaller.unmarshalSaxSource(AbstractMarshaller.java:341) at org.springframework.oxm.support.AbstractMarshaller.unmarshal(AbstractMarshaller.java:131) at org.springframework.batch.item.xml.StaxEventItemReader.doRead(StaxEventItemReader.java:222) at org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader.read(AbstractItemCountingItemStreamItemReader.java:87) at org.springframework.batch.sample.iosample.AbstractIoSampleTests.getCredits(AbstractIoSampleTests.java:92) at org.springframework.batch.sample.iosample.AbstractIoSampleTests.testUpdateCredit(AbstractIoSampleTests.java:53) Test 3 When I use the following environment : . Spring Batch 2.1.0.RELEASE . Spring 3.1.0.RELEASE . and WITHOUT spring-oxm and spring-xml modules from Spring WS (packages spring-xml and spring-oxm have been integrated into Spring since Spring 3). I got the ClassNotFoundException error when runngin XmlFunctionalTests : Code: java.lang.ClassNotFoundException : org.springframework.xml.transform.StaxSource Diagnosis and possible solution This is due to the fact that Spring 3 renamed the package org.springframework.xml.transform from Spring WS 1.5.9 into org.springframework.util.xml. So you must change the code for StaxEventItemReader and StaxEventItemWriter in order for Spring Batch to work with Spring 3.

    Spring JIRA | 7 years ago | cyril vid
    java.lang.UnsupportedOperationException: XStreamMarshaller does not support unmarshalling using SAX XMLReaders
  3. 0

    Using the following Spring Release : Spring Core 3.0.1 Spring Batch 2.1.1 or 2.0.2 Spring XML 1.5.9 Running the following code taken from the Spring Batch Manual : StaxEventItemReader<CustomerCredit> xmlStaxEventItemReader = new StaxEventItemReader(); Resource resource = new FileSystemResource("c:\\test.xml"); Map aliases = new HashMap(); aliases.put("customer","org.springframework.batch.sample.domain.CustomerCredit"); aliases.put("price","java.math.BigDecimal"); aliases.put("name","java.lang.String"); XStreamMarshaller marshaller = new XStreamMarshaller(); marshaller.setAliases(aliases); xmlStaxEventItemReader.setUnmarshaller(marshaller); xmlStaxEventItemReader.setResource(resource); xmlStaxEventItemReader.setFragmentRootElementName("customer"); xmlStaxEventItemReader.open(new ExecutionContext()); boolean hasNext = true; CustomerCredit credit = null; while (hasNext) { credit = xmlStaxEventItemReader.read(); if (credit == null) { hasNext = false; } else { System.out.println(credit); } Gives the following error : Exception in thread "main" java.lang.UnsupportedOperationException: XStreamMarshaller does not support unmarshalling using SAX XMLReaders at org.springframework.oxm.xstream.XStreamMarshaller.unmarshalSaxReader(XStreamMarshaller.java:460) at org.springframework.oxm.support.AbstractMarshaller.unmarshalSaxSource(AbstractMarshaller.java:341) at org.springframework.oxm.support.AbstractMarshaller.unmarshal(AbstractMarshaller.java:131) at org.springframework.batch.item.xml.StaxEventItemReader.doRead(StaxEventItemReader.java:222) at org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader.read(AbstractItemCountingItemStreamItemReader.java:85) This wasn't a problem using the same version of Spring Batch together with Spring WS 1.5.9 and Spring Core 2.5.6

    Spring JIRA | 7 years ago | Stijn Vranckx
    java.lang.UnsupportedOperationException: XStreamMarshaller does not support unmarshalling using SAX XMLReaders
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Using the following Spring Release : Spring Core 3.0.1 Spring Batch 2.1.1 or 2.0.2 Spring XML 1.5.9 Running the following code taken from the Spring Batch Manual : StaxEventItemReader<CustomerCredit> xmlStaxEventItemReader = new StaxEventItemReader(); Resource resource = new FileSystemResource("c:\\test.xml"); Map aliases = new HashMap(); aliases.put("customer","org.springframework.batch.sample.domain.CustomerCredit"); aliases.put("price","java.math.BigDecimal"); aliases.put("name","java.lang.String"); XStreamMarshaller marshaller = new XStreamMarshaller(); marshaller.setAliases(aliases); xmlStaxEventItemReader.setUnmarshaller(marshaller); xmlStaxEventItemReader.setResource(resource); xmlStaxEventItemReader.setFragmentRootElementName("customer"); xmlStaxEventItemReader.open(new ExecutionContext()); boolean hasNext = true; CustomerCredit credit = null; while (hasNext) { credit = xmlStaxEventItemReader.read(); if (credit == null) { hasNext = false; } else { System.out.println(credit); } Gives the following error : Exception in thread "main" java.lang.UnsupportedOperationException: XStreamMarshaller does not support unmarshalling using SAX XMLReaders at org.springframework.oxm.xstream.XStreamMarshaller.unmarshalSaxReader(XStreamMarshaller.java:460) at org.springframework.oxm.support.AbstractMarshaller.unmarshalSaxSource(AbstractMarshaller.java:341) at org.springframework.oxm.support.AbstractMarshaller.unmarshal(AbstractMarshaller.java:131) at org.springframework.batch.item.xml.StaxEventItemReader.doRead(StaxEventItemReader.java:222) at org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader.read(AbstractItemCountingItemStreamItemReader.java:85) This wasn't a problem using the same version of Spring Batch together with Spring WS 1.5.9 and Spring Core 2.5.6

    Spring JIRA | 7 years ago | Stijn Vranckx
    java.lang.UnsupportedOperationException: XStreamMarshaller does not support unmarshalling using SAX XMLReaders
  6. 0

    How to set setStackFromEnd(true); in GridLayoutManager for Recyclerview?

    Stack Overflow | 1 month ago | Jignesh Ansodariya
    java.lang.UnsupportedOperationException: GridLayoutManager does not support stack from end. Consider using reverse layout

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.UnsupportedOperationException

      XStreamMarshaller does not support unmarshalling using SAX XMLReaders

      at org.springframework.oxm.xstream.XStreamMarshaller.unmarshalSaxReader()
    2. Spring Object/XML Marshalling
      AbstractMarshaller.unmarshal
      1. org.springframework.oxm.xstream.XStreamMarshaller.unmarshalSaxReader(XStreamMarshaller.java:460)
      2. org.springframework.oxm.support.AbstractMarshaller.unmarshalSaxSource(AbstractMarshaller.java:341)
      3. org.springframework.oxm.support.AbstractMarshaller.unmarshal(AbstractMarshaller.java:131)
      3 frames
    3. Spring Batch Infrastructure
      AbstractItemCountingItemStreamItemReader.read
      1. org.springframework.batch.item.xml.StaxEventItemReader.doRead(StaxEventItemReader.java:222)
      2. org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader.read(AbstractItemCountingItemStreamItemReader.java:87)
      2 frames
    4. org.springframework.batch
      AbstractIoSampleTests.testUpdateCredit
      1. org.springframework.batch.sample.iosample.AbstractIoSampleTests.getCredits(AbstractIoSampleTests.java:92)
      2. org.springframework.batch.sample.iosample.AbstractIoSampleTests.testUpdateCredit(AbstractIoSampleTests.java:53)
      2 frames