Announcement Announcement Module
Collapse
No announcement yet.
Why doesn't my job do anything? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why doesn't my job do anything?

    Hi. I've been at this for a few hours and I'm running on little sleep. I've setup my job with what I thought was the correct XML, but nothing runs. Stepping through the code, I see that nothing is really called.

    Here's my XML:

    Code:
    <bean id="campusDataJob" parent="mySimpleJob">
       <property name="steps">
          <bean id="step1" parent="mySimpleStep">
             <property name="tasklet">
                <bean class="org.springframework.batch.execution.tasklet.ItemOrientedTasklet">
                   <property name="itemReader">
                      <bean class="com.howie.batch.spring.DataServiceReader"/>
                   </property>						
    
                   <property name="itemWriter">
                      <bean class="com.howie.batch.spring.LoggerItemWriter"/>
                   </property>						
                </bean>
             </property>
          </bean>
       </property>
    </bean>
    mySimpleJob just uses a SimpleJob, restartable = false.

    mySimpleStep injects the jobRepository, sets an exception handler, uses a commitInterval of 1, and does not save execution attributes, and allows starting if completed.

    What am I missing that's probably obvious to everyone else? I know my ItemReader has items in it and my ItemWriter simply logs the item to stdout... not that the read() or write() methods are being called. In fact, SimpleJob's execute() isn't being called, so I know I messed something up bigtime.

  • #2
    Samples

    How about trying one of the provided sample jobs as a start?

    Comment


    • #3
      If your job is restartable and you run it with the same parameters each time, it means you are restarting the same job instance all the time => no-op if it completed successfully before. If you wipe the metadata database and your job suddenly does something at the next run, that's the case.

      Comment


      • #4
        The best way to diagnose this problem is to examine the meta-data as Robert suggests. Check the JOB_EXECUTION table for the most recent attempt to run the job. Then run the job again and look at the newly created execution.

        If no execution was created, something is wrong with your job launcher configuration. Post back with your configuration so we can figure out what's up.

        If an execution was created, examine its exit code to get more of an idea of what's happening. Post back with the result and we can figure out what to do next.

        Comment


        • #5
          As a side note, this scenario will throw an exception in M5.

          Comment

          Working...
          X