Spring Batch: org.springframework.batch.item.ReaderNotOpenException: Reader must be open before it can be read

前端 未结 7 1137
独厮守ぢ
独厮守ぢ 2020-12-15 05:24

I read SO related questions but the solutions don\'t work for me.

I get the org.springframework.batch.item.ReaderNotOpenException: Reader must be open before i

相关标签:
7条回答
  • 2020-12-15 05:51

    The issue disappeared when I change the return type of my reader bean from Item to FlatFileItemReader. It is still not clear to me why this is a problem since chunk().reader() accepts ItemReader as an input. I assume that there is some AOP magic under the hood which does FlatFileReader init and matches by the return type.

    0 讨论(0)
提交回复
热议问题