-
Mar 16th, 2010, 10:22 PM
#1
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
-
Mar 19th, 2010, 09:25 AM
#2
Make sure your reader has the "step" scope in the bean definition. If that does not help, please show your code.
-
Apr 6th, 2010, 06:26 AM
#3
-
Apr 6th, 2010, 07:08 AM
#4

Originally Posted by
sachin.tyagi
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
-
Forum Rules