Results 1 to 5 of 5

Thread: Bug [#BATCH-828] in RC2?

  1. #1
    Join Date
    Mar 2009
    Posts
    19

    Default Bug [#BATCH-828] in RC2?

    Hello,

    I'm using Quartz to schedule job that has 2 steps:
    1) Using MultiResourceItemReader to read and process files from predefinedd folder
    2) Move files from that folder to completed
    After the first run I receive exception, and it looks like MRIR is trying to get the same files from input directory
    Code:
    11:30:42,328 DEBUG org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-3 AbstractStep:261 - Step execution complete: StepExecution: id=643, name=load, status=FAILED, exitStatus=exitCode=FAILED;exitDescription=org.springframework.batch.item.ItemStreamException: Failed to initialize the reader
    	at org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader.open(AbstractItemCountingItemStreamItemReader.java:111)
    	at com.cce.filenet.reports.FlatFileReaderWrapper.open(FlatFileReaderWrapper.java:63)
    	at org.springframework.batch.item.file.MultiResourceItemReader.open(MultiResourceItemReader.java:154)
    	at org.springframework.batch.item.support.CompositeItemStream.open(CompositeItemStream.java:98)
    	at org.springframework.batch.core.step.item.ChunkMonitor.open(ChunkMonitor.java:106)
    	at org.springframework.batch.item.support.CompositeItemStream.open(CompositeItemStream.java:98)
    	at org.springframework.batch.core.step.tasklet.TaskletStep.open(TaskletStep.java:364)
    	at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:193)
    	at org.springframework.batch.core.job.AbstractJob.handleStep(AbstractJob.java:345)
    	at org.springframework.batch.core.job.flow.FlowJob.access$100(FlowJob.java:37)
    	at org.springframework.batch.core.job.flow.FlowJob$JobFlowExecutor.executeStep(FlowJob.java:131)
    	at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:60)
    	at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:137)
    	at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:120)
    	at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:99)
    	at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:248)
    	at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:110)
    	at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
    	at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:105)
    	at com.cce.filenet.quartz.JobLauncherDetails.executeInternal(JobLauncherDetails.java:53)
    	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
    	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
    Caused by: java.lang.IllegalStateException: Input resource must exist (reader is in 'strict' mode): file [C:\Projects\ReportUpdater\bin\data\output\SpringBoard_AR_INV\Copy of 1.fna]
    	at org.springframework.batch.item.file.FlatFileItemReader.doOpen(FlatFileItemReader.java:245)
    	at org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader.open(AbstractItemCountingItemStreamItemReader.java:108)
    	... 22 more
    Here's the configuration I'm using for MRIR

    HTML Code:
    	<beans:bean id="SpringBoard_AR_DDItemReader" class="org.springframework.batch.item.file.MultiResourceItemReader">
    		<beans:property name="resources" value="file://${spring.dd.input.dir}/*.fna" />
    		<beans:property name="delegate" ref="SpringBoard_AR_DDwrapperFileReader" />
    		<beans:property name="saveState" value="true" />
    	</beans:bean>
    Does it the same BATCH-828 or I misunderstand how it suppose to work?

    Regards,
    Igor

  2. #2
    Join Date
    Mar 2009
    Posts
    19

    Default

    Ok, it looks like reader should have scope="step".
    Now it works.

  3. #3
    Join Date
    Apr 2008
    Posts
    174

    Default

    hey I am getting the same error... did you just set the scope"step" for the readers and writers? I tried but still getting the error: Input resource must exist (reader is in 'strict' mode)

    Can you help please?

  4. #4
    Join Date
    Mar 2009
    Posts
    19

    Default

    I added scope=step to reader only and it did help me.
    Job:
    HTML Code:
    	<job id="SpringBoard_AR_DD_Job">
    				<step id="load_SBARDD" next="moveToComplete_SBARDD">
    					 <tasklet>
    						<chunk reader="ItemReader_SBARDD" writer="ItemWriter_SBARDD" commit-interval="${job.commit.interval}" skip-limit="${skip.limit}">
    							<skippable-exception-classes>
    								 org.springframework.dao.DataIntegrityViolationException
    							</skippable-exception-classes>
    						</chunk>		     
    						<listeners>
    							<listener ref="stepListener_SBARDD"/>
    						</listeners>
    					</tasklet>               
    				</step>
    	</job>
    Reader:
    HTML Code:
    
    	<beans:bean id="ItemReader_SBARDD" scope="step" class="org.springframework.batch.item.file.MultiResourceItemReader">
    		<beans:property name="resources" value="file://${spring.dd.input.dir}/*.fna" />
    		<beans:property name="delegate" ref="wrapperFileReader_SBARDD" />
    	</beans:bean>

  5. #5
    Join Date
    Apr 2008
    Posts
    174

    Default

    Thanks! Let me give that a try!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •