It appears to me as a design issue based on what I've observed below:
At the time of Spring context initialization i.e. at application startup there are no files in the location the job is referring to, as shown in the log below:
Code:
2012-08-13 18:36:15,271 INFO - Initializing No of resources for MultiResourceReader - 0 --setResources called here
2012-08-13 18:36:15,505 INFO - Starting beans in phase 2147483647
2012-08-13 18:36:15,505 INFO - Starting Quartz Scheduler now
2012-08-13 18:36:15,505 INFO - Root WebApplicationContext: initialization completed in 4562 ms
After initialization, a second job runs which loads the file into input location of job using MultiResourceReader. Then when the job runs the MultiResourceReader does not read or identify files added after spring context initialization and fails with the error.
Code:
2012-08-13 18:50:00,203 INFO - Job: [FlowJob: [name=readFiles]] launched with the following parameters: []
2012-08-13 18:50:00,234 INFO - Job [readFiles] is starting
2012-08-13 18:50:00,312 INFO - Executing step: [loadFiles]
2012-08-13 18:50:00,343 WARN - No resources to read. Set strict=true if this should be an error condition.
2012-08-13 18:50:00,375 INFO - Reading a line from MultiResourceReader
NOTE: The log printed in the previous log output is not shown in the log statements above i.e. the setResources is not called when the job executes.
Hence, it appears as if MultiResourceReader works only when resources are available only during Spring context initialization and is unable to detect resources added/removed at runtime.
Any suggestions?