java – Spring Batch:org. springframework. batch. item. Reader notopenexception: the reader must open it before reading
I read about the problem, but the solution didn't work for me
I got org springframework. batch. item. Reader not openexception: the reader must open it to read the exception
Here is my configuration:
The inputzipfile variable is set correctly and the file exists on the drive I checked the flatfileitemreader code, and the reader notopenexception occurs when the reader member of the reader class is not set The reader member is set to the Dopen method It seems that Dopen is not called The question is why?
Solution
When I changed the return type of the reader bean from item to flatfileitemreader, the problem disappeared I still don't know why this is a problem because chunk() Reader () accepts itemreader as input I assume that there are some AOP magic under the hood, flatfilereader init and return type match