Announcement Announcement Module
No announcement yet.
job enters infinite loop Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • job enters infinite loop

    I have defined a job with custom item reader, writer and processor. It doesn't do much, just dummy things, but it enters an infinite loop. In the log I see that after an item writer finishes the execution, the item reader is directly called; in other words the steps repeats again and again and never finishes. I cannot figure out what should be done in order to make a step complete.

    These are job configurations:
    	<batch:job id="myJob" >
    	  <batch:step id="myStep" >
    	    <batch:tasklet >
    	      <batch:chunk reader="myReader" processor="myProcessor" writer="myWriter" commit-interval="1" />
        <bean id="jobLauncher" class="">
            <property name="jobRepository" ref="jobRepository"/>
    	<bean id="transactionManager" class=""/>
    	<bean id="jobRepository"
    		<property name="transactionManager" ref="transactionManager"/>
    		<property name="isolationLevelForCreate" value="ISOLATION_DEFAULT"/>
    Reader, Processor, Writer:
    public class DummyReader implements ItemReader < String > {
       public String read ( ) {
         return "dummy";
    public class DummyProcessor implements ItemProcessor < String, String> {
    	public String process ( String item ) throws Exception {
    		//do nothing
    		return item;
    public class DummyWriter implements ItemWriter < String > {
    	public void write ( List < ? extends String > items ) throws Exception {
                //do nothing
    Last edited by meremortal; Jul 2nd, 2010, 05:22 AM.

  • #2
    Your ItemReader doesn't follow the contract from the interface (
    Last edited by Dave Syer; Jul 5th, 2010, 07:37 AM. Reason: Updated URL link


    • #3
      Thanks Dave. It wasn't obvious to me when I was reading the user guide and I made a different assumption about the way it should work; and I did not look into the api docs.