Explain Down Vote
Explain Down Vote

Reputation: 161

org.springframework.batch.item.ItemStreamException: Failed to initialize the reader on second api call

getting the error in the title when trying to invoke a springbatchjob secondtime with the same xlsx file.

Technologies used : Springbatch,springboot,mysql,java,springbatchexcel.

Upvotes: 0

Views: 940

Answers (1)

Michael Minella
Michael Minella

Reputation: 21483

Without seeing your configuration, my expectation is that your ItemReader is not step scoped. Because of this, you use the same instance across multiple executions which can cause that error. I'd bet if you changed that reader to step scoped, the issue will go away.

Upvotes: 0

Related Questions