Jun 7th, 2010, 03:33 AM
Strange File access problem in spring batch
I am using 2.1.0.release spring batch version and facing problem while reading from a flat file.
Scenario is, in first step m downloading file from ftp and saving the same in local hard disk. In next step i am reading the same file and updating database.
Even though first step gets completed successfully but FlatFileItemReader is not able to find the file and throws the exception "Input resource must exist (reader is in 'strict' mode): filename". I am running my application using eclipse 3.4.
but as soon as file gets generated and if i refresh my eclipse project, FlatFileItemReader is able to locate the file.
Same file if i try to read using FileInputStream, its able to locate the file. Please guys help me in this issue...
Any help will be really appreciated..
Thanks in advance
Jun 11th, 2010, 06:23 AM
Make your reader scope="step" and it will not be initialized until the step is started.