Results 1 to 9 of 9

Thread: Multithreading with Stax input files exception ?

Threaded View

  1. #1
    Join Date
    Dec 2007
    Posts
    15

    Default Multithreading with Stax input files exception ?

    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:

    Code:
    10:09:56,863 DEBUG SimpleAsyncTaskExecutor-1 TransactionTemplate:151 - Initiating transaction rollback on application exception
    org.springframework.dao.DataAccessResourceFailureException: 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.StaxEventReaderInputSource.moveCursorToNextFragment(StaxEventReaderInputSource.java:261)
        at org.springframework.batch.io.file.support.StaxEventReaderInputSource.read(StaxEventReaderInputSource.java:88)
        at org.springframework.batch.io.file.support.StaxEventReaderInputSource$$FastClassByCGLIB$$db438604.invoke(<generated>)
        at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
        at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:694)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
        at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
        at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:629)
        at org.springframework.batch.io.file.support.StaxEventReaderInputSource$$EnhancerByCGLIB$$94aa0c51.read(<generated>)
        at org.springframework.batch.item.provider.InputSourceItemProvider.next(InputSourceItemProvider.java:48)
        at org.springframework.batch.execution.tasklet.ItemProviderProcessTasklet.execute(ItemProviderProcessTasklet.java:141)
        at org.springframework.batch.execution.step.simple.SimpleStepExecutor.doTaskletProcessing(SimpleStepExecutor.java:372)
        at org.springframework.batch.execution.step.simple.DefaultStepExecutor.doTaskletProcessing(DefaultStepExecutor.java:61)
        at org.springframework.batch.execution.step.simple.SimpleStepExecutor$2.doInIteration(SimpleStepExecutor.java:347)
        at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:324)
        at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:201)
        at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:131)
        at org.springframework.batch.execution.step.simple.SimpleStepExecutor.processChunk(SimpleStepExecutor.java:334)
        at org.springframework.batch.execution.step.simple.SimpleStepExecutor$1$2.doInTransaction(SimpleStepExecutor.java:220)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:127)
        at org.springframework.batch.execution.step.simple.SimpleStepExecutor$1.doInIteration(SimpleStepExecutor.java:208)
        at org.springframework.batch.repeat.support.TaskExecutorRepeatTemplate$ExecutingRunnable.run(TaskExecutorRepeatTemplate.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.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:588)
        at com.sun.xml.internal.stream.XMLEventReaderImpl.peek(XMLEventReaderImpl.java:271)
        at org.springframework.batch.io.file.support.stax.DefaultTransactionalEventReader.peek(DefaultTransactionalEventReader.java:86)
        at org.springframework.batch.io.file.support.stax.DefaultFragmentEventReader.peek(DefaultFragmentEventReader.java:152)
        at org.springframework.batch.io.file.support.StaxEventReaderInputSource.moveCursorToNextFragment(StaxEventReaderInputSource.java:246)
        ... 24 more

    Maybe I did something wrong or does anybody know if it should be working ?

    G.C.
    Last edited by gcollin; Dec 3rd, 2007 at 04:36 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •