Announcement Announcement Module
Collapse
No announcement yet.
JdbcCursorItemReader is hung Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JdbcCursorItemReader is hung

    Hi,

    I've a job which writes a flat file after reading the data from database using JdbcCursorItemReader.

    Also, I've a ItemWriteListener which is registered inside <chunk>ItemWriteListener</chunk>.

    When, I remove/disable the ItemWriteListener job runs fine. However, when I enable the ItemWriteListener job seems to be hung at reading rows from database. Because, in the step execution read count is 0 and step execution status is EXECUTING and Job status is STARTED.

    Any ideas?

    Let me know if you need more information?


    ---------update---------
    The job is scheduled to run every 10 mins so the next execution throws following exception which indicates it is a reader which is hung.
    Code:
    org.springframework.batch.item.ItemStreamException: Failed to initialize the reader
    	at org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader.open(AbstractItemCountingItemStreamItemReader.java:137)
    	at org.springframework.batch.item.support.CompositeItemStream.open(CompositeItemStream.java:93)
    	at org.springframework.batch.core.step.tasklet.TaskletStep.open(TaskletStep.java:301)
    	at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:192)
    	at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:135)
    	at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:61)
    	at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:60)
    	at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:144)
    	at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:124)
    	at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:135)
    	at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:281)
    	at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:120)
    	at java.lang.Thread.run(Thread.java:811)
    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.AbstractCursorItemReader.doOpen(AbstractCursorItemReader.java:397)
    	at org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader.open(AbstractItemCountingItemStreamItemReader.java:134)
    Last edited by tiger.spring; Apr 28th, 2011, 01:15 PM. Reason: provide additional information
Working...
X