Java Reference
In-Depth Information
<job id="classifierFormatJob">
<step id="step1" parent="formatFileStep"/>
</job>
When you build and run classifierFormatJob via the statement java -jar itemWriters-0.0.1-
SNAPSHOT.jar jobs/formatJob.xml formatJob customerFile=/input/customerWithEmail.csv
outputFile=/output/xmlCustomer.xml , you're met with a bit of a surprise. It doesn't work. Instead of the
normal output of Spring telling you the job completed as expected, you're met with an exception, as
shown in Listing 9-79.
Listing 9-79. Results of classifierFormatJob
2011-03-15 22:46:53,647 DEBUG main [org.springframework.batch.core.step.tasklet.TaskletStep]
- <Applying contribution: [StepContribution: read=10, written=0, filtered=0, readSkips=0,
writeSkips=0, processSkips=0, exitStatus=EXECUTING]>
2011-03-15 22:46:53,647 DEBUG main
[org.springframework.batch.core.step.tasklet.TaskletStep] - <Rollback for
RuntimeException: java.lang.IllegalArgumentException: StaxResult contains
neither XMLStreamWriter nor XMLEventConsumer>
2011-03-15 22:46:53,648 DEBUG main
[org.springframework.batch.repeat.support.RepeatTemplate] - <Handling
exception: java.lang.IllegalArgumentException, caused by:
java.lang.IllegalArgumentException: StaxResult contains neither
XMLStreamWriter nor XMLEventConsumer>
2011-03-15 22:46:53,648 DEBUG main
[org.springframework.batch.repeat.support.RepeatTemplate] - <Handling fatal
exception explicitly (rethrowing first of 1):
java.lang.IllegalArgumentException: StaxResult contains neither
XMLStreamWriter nor XMLEventConsumer>
2011-03-15 22:46:53,649 ERROR main
[org.springframework.batch.core.step.AbstractStep] - <Encountered an error
executing the step>
java.lang.IllegalArgumentException: StaxResult contains neither
XMLStreamWriter nor XMLEventConsumer
at
org.springframework.oxm.AbstractMarshaller.marshalStaxResult(AbstractMarshall
er.java:217)
at org.springframework.oxm.AbstractMarshaller.marshal(AbstractMarshaller.java:91)
at org.springframework.batch.item.xml.StaxEventItemWriter.write(StaxEventItemWri
ter.java:573)
at
org.springframework.batch.item.support.ClassifierCompositeItemWriter.write(Cl
assifierCompositeItemWriter.java:65)
at
org.springframework.batch.core.step.item.SimpleChunkProcessor.writeItems(Simp
leChunkProcessor.java:171)
at org.springframework.batch.core.step.item
 
 
Search WWH ::




Custom Search