Announcement Announcement Module
Collapse
No announcement yet.
problem with update ExitStatus Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • problem with update ExitStatus

    Hello, everyone

    I have problem with update EXIT_MESSAGE column in batch_step_execution table.

    My situation : 1. I have reader which read FlatFileItemReader in my job configuration
    2. When I use jobLauncher to run my job. Spring batch will throw exception because
    Input resource does not exists.
    3. In afterStep method I create ExitStatus with EXIT_CODE='FAILED'
    and EXIT_MESSAGE='exception id which i create'
    4. I return ExitStatus.
    In my situation spring batch update "FAILED" to EXIT_CODE column but not update "exception id" to
    EXIT_MESSAGE column. Can anyone help me?

    Example :
    - read Flat File
    <bean id="readAuditData" class="org.springframework.batch.item.file.FlatFil eItemReader"
    <property name="resource" value="file:\ATM20120717.txt" /> -- this line cause spring batch error
    <property name="strict" value="true" />
    .....
    </bean>

    - in afterStep method
    @Override
    public ExitStatus afterStep(StepExecution stepExecution)
    {
    ExitStatus exitstatus = new ExitStatus(stepExecution.getExitStatus().getExitCo de());
    String exceptionId = getExceptionId( stepExecution.getFailureExceptions() );
    exitstatus.addExitDescription( exceptionId );
    return exitstatus
    // After return exitstatus, EXIT_MESSAGE column not update. why?
    }
    I use spring batch 2.1.8.
    Please ask me If you don't understand my question because english language is not my first language.

    Thank you
    Last edited by bigmasapon; Aug 7th, 2012, 03:09 AM.
Working...
X