Results 1 to 4 of 4

Thread: java.lang.IllegalStateException: Stream is already initialized.Close before re-opene

  1. #1

    Default java.lang.IllegalStateException: Stream is already initialized.Close before re-opene

    I am getting the below exception while using SPring batch. Trying to read the sequentiona flat file and update the database.

    Please help on this below.

    ------------------------------------------------------------------
    15-Mar-2010 14:28:25.909: ERROR AbstractStep:215 - Encountered an error executing the step
    org.springframework.batch.item.ItemStreamException : Failed to initialize the reader
    at org.springframework.batch.item.support.AbstractIte mCountingItemStreamItemReader.open(AbstractItemCou ntingItemStreamItemReader.java:139)
    at org.springframework.batch.item.support.CompositeIt emStream.open(CompositeItemStream.java:98)
    at org.springframework.batch.core.step.tasklet.Taskle tStep.open(TaskletStep.java:379)
    at org.springframework.batch.core.step.AbstractStep.e xecute(AbstractStep.java:195)
    at org.springframework.batch.core.job.AbstractJob.han dleStep(AbstractJob.java:348)
    at org.springframework.batch.core.job.flow.FlowJob.ac cess$0(FlowJob.java:1)
    at org.springframework.batch.core.job.flow.FlowJob$Jo bFlowExecutor.executeStep(FlowJob.java:135)
    at org.springframework.batch.core.job.flow.support.st ate.StepState.handle(StepState.java:60)
    at org.springframework.batch.core.job.flow.support.Si mpleFlow.resume(SimpleFlow.java:144)
    at org.springframework.batch.core.job.flow.support.Si mpleFlow.start(SimpleFlow.java:124)
    at org.springframework.batch.core.job.flow.FlowJob.do Execute(FlowJob.java:103)
    at org.springframework.batch.core.job.AbstractJob.exe cute(AbstractJob.java:250)
    at org.springframework.batch.core.launch.support.Simp leJobLauncher$1.run(SimpleJobLauncher.java:110)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.IllegalStateException: Stream is already initialized. Close before re-opening.
    at org.springframework.util.Assert.state(Assert.java: 384)
    at org.springframework.batch.item.database.JdbcCursor ItemReader.doOpen(JdbcCursorItemReader.java:460)
    at org.springframework.batch.item.support.AbstractIte mCountingItemStreamItemReader.open(AbstractItemCou ntingItemStreamItemReader.java:137)
    ... 13 more

  2. #2

    Default

    Make sure your reader has the "step" scope in the bean definition. If that does not help, please show your code.

  3. #3

    Default

    Step scope not working..

  4. #4

    Default

    Quote Originally Posted by sachin.tyagi View Post
    Step scope not working..
    If that does not help, please show your code.

Posting Permissions

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