Back Forum Reply New

UnsupportedOperationException + XStreamMarshaller

Dear Members

I am working with Spring Batch 2.1.2.RELEASE with Maven

I have created this project with the follow commmandsCode:
svn export svn/spring-batch/tags/2.1.3.RELEASE/archetypes/simple-cli manolitoJob

svn export svn/spring-batch/tags/2.1.3.RELEASE/spring-batch-core/src/main/resources/manolitoJob/src/main/resources --force
The POM has this properties tagCode:
lt;propertiesgt;
lt;maven.test.failure.ignoregt;truelt;/maven.test.failure.ignoregt;
lt;spring.framework.versiongt;2.5.6lt;/spring.framework.versiongt;
lt;spring.batch.versiongt;2.1.2.RELEASElt;/spring.batch.versiongt;
lt;dependency.locations.enabledgt;falselt;/dependency.locations.enabledgt;
lt;/propertiesgt;
Realize about Spring Framework version 2.5.6 and the follow are all the Spring Core dependencies:Code:
lt;dependencygt;
lt;groupIdgt;org.lt;/groupIdgt;
lt;artifactIdgt;spring-testlt;/artifactIdgt;
lt;versiongt;${spring.framework.version}lt;/versiongt;
lt;scopegt;testlt;/scopegt;
lt;/dependencygt;
lt;dependencygt;
lt;groupIdgt;org.lt;/groupIdgt;
lt;artifactIdgt;spring-contextlt;/artifactIdgt;
lt;versiongt;${spring.framework.version}lt;/versiongt;
lt;/dependencygt;
lt;dependencygt;
lt;groupIdgt;org.lt;/groupIdgt;
lt;artifactIdgt;spring-aoplt;/artifactIdgt;
lt;versiongt;${spring.framework.version}lt;/versiongt;
lt;/dependencygt;
lt;dependencygt;
lt;groupIdgt;org.lt;/groupIdgt;
lt;artifactIdgt;spring-jdbclt;/artifactIdgt;
lt;versiongt;${spring.framework.version}lt;/versiongt;
lt;/dependencygt;
by OXM dependencies I need add the followCode:
lt;dependencygt;
lt;groupIdgt;org.lt;/groupIdgt;
lt;artifactIdgt;org..oxmlt;/artifactIdgt;
lt;versiongt;3.0.5.RELEASElt;/versiongt; lt;!-- ${spring.framework.version} No --gt;
lt;/dependencygt;
lt;dependencygt;
lt;groupIdgt;org..wslt;/groupIdgt;
lt;artifactIdgt;org..xmllt;/artifactIdgt;
lt;versiongt;2.0.0.RELEASElt;/versiongt;
lt;/dependencygt;
Realize yourself I am working with 3.0.5.RELEASE and not with ${spring.framework.version} (2.5.6)

Now, since in SS repository only return the follow to org..oxm search, see carefully in the link that only show to 1.5.X and 3.0.X, and nothing about 2.5.x

OK I have the follow configurationCode:
lt;beans:bean id=quot;customerFileReaderquot; class=quot;org..batch.item.xml.StaxEventItemReaderquot;gt;
lt;beans:property name=quot;fragmentRootElementNamequot; value=quot;customerquot; /gt;
lt;beans:property name=quot;resourcequot; ref=quot;customerFilequot; /gt;
lt;beans:property name=quot;unmarshallerquot; ref=quot;customerMarshallerquot; /gt;
lt;/beans:beangt;

lt;beans:bean id=quot;customerMarshallerquot; class=quot;org..oxm.xstream.XStreamMarshallerquot;gt;
lt;beans:property name=quot;aliasesquot;gt;
lt;beans:mapgt;
lt;beans:entry key=quot;customerquot; value=quot;quot;com.jordan......Customerquot; /gt;
lt;beans:entry key=quot;transactionquot; value=quot;quot;com.jordan......Transactionquot; /gt;
lt;beans:entry key=quot;accountquot; value=quot;java.lang.Stringquot;/gt;
lt;beans:entry key=quot;zipquot; value=quot;java.lang.Stringquot;/gt;
lt;/beans:mapgt;
lt;/beans:propertygt;
lt;beans:property name=quot;implicitCollectionsquot;gt;
lt;beans:mapgt;
lt;beans:entry key=quot;com.jordan.....Customerquot; value=quot;transactionsquot; /gt;
lt;/beans:mapgt;
lt;/beans:propertygt;
lt;beans:property name=quot;convertersquot;gt;
lt;beans:listgt;
lt;beans:ref local=quot;dateConverterquot;/gt;
lt;/beans:listgt;
lt;/beans:propertygt;
lt;/beans:beangt;
when I execute I got the follow exceptionCode:
2011-02-15 21:30:42,625 ERROR main
[org..batch.core.step.AbstractStep] -
lt;Encountered an error executing the stepgt;
java.lang.UnsupportedOperationException:
XStreamMarshaller does not support unmarshalling using SAX XMLReaders
I research in the forum and I only found out only these both theread about this exception
StaxEventItemReader + Xstream unmarshaller =gt; KO
PartitionHandler: step.execute() throws exception on remote machine

Therefore is it a bug? or could be an internal problem since I am working with org..oxm 3.0.5.RELEASE with Spring Framework version 2.5.6

Thanks in advanced

spring-oxm before spring 3 was part of spring webservice and not of the core spring project. It is since spring 3. In your case don't use spring-oxm from spring 3 use the spring-ws version or move to spring3 .

Hello Marten

Thanks a lot for the explanation, it has sense, after to wrote this post I found out this post in French or Italian, seems very closely related with your solution

I will try do my experiments

Best Regards Friend
¥
Back Forum Reply New