gcollin
Dec 3rd, 2007, 04:31 AM
Hi,
I'm defining a batch solution for our product used in insurance and banking.
I'm currently investigating Spring-batch, which seems a near-perfect solution to our needs.. ;)
Using trunk or 1.0m2, when I try to setup a multithreading processing of an XML input file using StaxEventReaderInputSource and TaskExecutorRepeatTemplate with SimpleAsyncTaskExecutor, I get the following error:
10:09:56,863 DEBUG SimpleAsyncTaskExecutor-1 TransactionTemplate:151 - Initiating transaction rollback on application exception
org.springframework.dao.DataAccessResourceFailureE xception: Error while reading from event reader; nested exception is javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: Content is not allowed in prolog.
at org.springframework.batch.io.file.support.StaxEven tReaderInputSource.moveCursorToNextFragment(StaxEv entReaderInputSource.java:261)
at org.springframework.batch.io.file.support.StaxEven tReaderInputSource.read(StaxEventReaderInputSource .java:88)
at org.springframework.batch.io.file.support.StaxEven tReaderInputSource$$FastClassByCGLIB$$db438604.inv oke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy. java:149)
at org.springframework.aop.framework.Cglib2AopProxy$C glibMethodInvocation.invokeJoinpoint(Cglib2AopProx y.java:694)
at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :149)
at org.springframework.aop.support.DelegatingIntroduc tionInterceptor.doProceed(DelegatingIntroductionIn terceptor.java:131)
at org.springframework.aop.support.DelegatingIntroduc tionInterceptor.invoke(DelegatingIntroductionInter ceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
at org.springframework.aop.framework.Cglib2AopProxy$D ynamicAdvisedInterceptor.intercept(Cglib2AopProxy. java:629)
at org.springframework.batch.io.file.support.StaxEven tReaderInputSource$$EnhancerByCGLIB$$94aa0c51.read (<generated>)
at org.springframework.batch.item.provider.InputSourc eItemProvider.next(InputSourceItemProvider.java:48 )
at org.springframework.batch.execution.tasklet.ItemPr oviderProcessTasklet.execute(ItemProviderProcessTa sklet.java:141)
at org.springframework.batch.execution.step.simple.Si mpleStepExecutor.doTaskletProcessing(SimpleStepExe cutor.java:372)
at org.springframework.batch.execution.step.simple.De faultStepExecutor.doTaskletProcessing(DefaultStepE xecutor.java:61)
at org.springframework.batch.execution.step.simple.Si mpleStepExecutor$2.doInIteration(SimpleStepExecuto r.java:347)
at org.springframework.batch.repeat.support.RepeatTem plate.getNextResult(RepeatTemplate.java:324)
at org.springframework.batch.repeat.support.RepeatTem plate.executeInternal(RepeatTemplate.java:201)
at org.springframework.batch.repeat.support.RepeatTem plate.iterate(RepeatTemplate.java:131)
at org.springframework.batch.execution.step.simple.Si mpleStepExecutor.processChunk(SimpleStepExecutor.j ava:334)
at org.springframework.batch.execution.step.simple.Si mpleStepExecutor$1$2.doInTransaction(SimpleStepExe cutor.java:220)
at org.springframework.transaction.support.Transactio nTemplate.execute(TransactionTemplate.java:127)
at org.springframework.batch.execution.step.simple.Si mpleStepExecutor$1.doInIteration(SimpleStepExecuto r.java:208)
at org.springframework.batch.repeat.support.TaskExecu torRepeatTemplate$ExecutingRunnable.run(TaskExecut orRepeatTemplate.java:227)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: Content is not allowed in prolog.
at com.sun.org.apache.xerces.internal.impl.XMLStreamR eaderImpl.next(XMLStreamReaderImpl.java:588)
at com.sun.xml.internal.stream.XMLEventReaderImpl.pee k(XMLEventReaderImpl.java:271)
at org.springframework.batch.io.file.support.stax.Def aultTransactionalEventReader.peek(DefaultTransacti onalEventReader.java:86)
at org.springframework.batch.io.file.support.stax.Def aultFragmentEventReader.peek(DefaultFragmentEventR eader.java:152)
at org.springframework.batch.io.file.support.StaxEven tReaderInputSource.moveCursorToNextFragment(StaxEv entReaderInputSource.java:246)
... 24 more
Maybe I did something wrong or does anybody know if it should be working ?
G.C.
I'm defining a batch solution for our product used in insurance and banking.
I'm currently investigating Spring-batch, which seems a near-perfect solution to our needs.. ;)
Using trunk or 1.0m2, when I try to setup a multithreading processing of an XML input file using StaxEventReaderInputSource and TaskExecutorRepeatTemplate with SimpleAsyncTaskExecutor, I get the following error:
10:09:56,863 DEBUG SimpleAsyncTaskExecutor-1 TransactionTemplate:151 - Initiating transaction rollback on application exception
org.springframework.dao.DataAccessResourceFailureE xception: Error while reading from event reader; nested exception is javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: Content is not allowed in prolog.
at org.springframework.batch.io.file.support.StaxEven tReaderInputSource.moveCursorToNextFragment(StaxEv entReaderInputSource.java:261)
at org.springframework.batch.io.file.support.StaxEven tReaderInputSource.read(StaxEventReaderInputSource .java:88)
at org.springframework.batch.io.file.support.StaxEven tReaderInputSource$$FastClassByCGLIB$$db438604.inv oke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy. java:149)
at org.springframework.aop.framework.Cglib2AopProxy$C glibMethodInvocation.invokeJoinpoint(Cglib2AopProx y.java:694)
at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :149)
at org.springframework.aop.support.DelegatingIntroduc tionInterceptor.doProceed(DelegatingIntroductionIn terceptor.java:131)
at org.springframework.aop.support.DelegatingIntroduc tionInterceptor.invoke(DelegatingIntroductionInter ceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
at org.springframework.aop.framework.Cglib2AopProxy$D ynamicAdvisedInterceptor.intercept(Cglib2AopProxy. java:629)
at org.springframework.batch.io.file.support.StaxEven tReaderInputSource$$EnhancerByCGLIB$$94aa0c51.read (<generated>)
at org.springframework.batch.item.provider.InputSourc eItemProvider.next(InputSourceItemProvider.java:48 )
at org.springframework.batch.execution.tasklet.ItemPr oviderProcessTasklet.execute(ItemProviderProcessTa sklet.java:141)
at org.springframework.batch.execution.step.simple.Si mpleStepExecutor.doTaskletProcessing(SimpleStepExe cutor.java:372)
at org.springframework.batch.execution.step.simple.De faultStepExecutor.doTaskletProcessing(DefaultStepE xecutor.java:61)
at org.springframework.batch.execution.step.simple.Si mpleStepExecutor$2.doInIteration(SimpleStepExecuto r.java:347)
at org.springframework.batch.repeat.support.RepeatTem plate.getNextResult(RepeatTemplate.java:324)
at org.springframework.batch.repeat.support.RepeatTem plate.executeInternal(RepeatTemplate.java:201)
at org.springframework.batch.repeat.support.RepeatTem plate.iterate(RepeatTemplate.java:131)
at org.springframework.batch.execution.step.simple.Si mpleStepExecutor.processChunk(SimpleStepExecutor.j ava:334)
at org.springframework.batch.execution.step.simple.Si mpleStepExecutor$1$2.doInTransaction(SimpleStepExe cutor.java:220)
at org.springframework.transaction.support.Transactio nTemplate.execute(TransactionTemplate.java:127)
at org.springframework.batch.execution.step.simple.Si mpleStepExecutor$1.doInIteration(SimpleStepExecuto r.java:208)
at org.springframework.batch.repeat.support.TaskExecu torRepeatTemplate$ExecutingRunnable.run(TaskExecut orRepeatTemplate.java:227)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: Content is not allowed in prolog.
at com.sun.org.apache.xerces.internal.impl.XMLStreamR eaderImpl.next(XMLStreamReaderImpl.java:588)
at com.sun.xml.internal.stream.XMLEventReaderImpl.pee k(XMLEventReaderImpl.java:271)
at org.springframework.batch.io.file.support.stax.Def aultTransactionalEventReader.peek(DefaultTransacti onalEventReader.java:86)
at org.springframework.batch.io.file.support.stax.Def aultFragmentEventReader.peek(DefaultFragmentEventR eader.java:152)
at org.springframework.batch.io.file.support.StaxEven tReaderInputSource.moveCursorToNextFragment(StaxEv entReaderInputSource.java:246)
... 24 more
Maybe I did something wrong or does anybody know if it should be working ?
G.C.