title: Spring Batch Step Failure
body: <p>In case of step failure in a multi-step batch , the step fail message is shown on console.
  Also the <code>BATCH_STATUS</code> is <code>COMPLETED</code> and <code>EXIT_STATUS</code> is <code>FAILED.</code></p>
  
  <p>Q.1 How to change the <code>EXIT_STATUS</code> to <code>COMPLETED</code>?</p>
  
  <p>Q.2 Is it anyway possible not to show failure message in console</p>
  
  <p>Sample Code</p>
  
  <pre><code> &lt;job id="someJob" xmlns="http://www.springframework.org/schema/batch"
       restartable="true" parent="baseJob"&gt;
      &lt;step id="aStep"&gt;
          &lt;job ref="aJob" /&gt;
          &lt;next on="*" to="bStep"/&gt;
      &lt;/step&gt;
      &lt;step id="bStep" parent="aStep" next="cStep"&gt;
          &lt;job ref="bJob"/&gt;
      &lt;/step&gt;
      &lt;step id="cStep" parent="bStep"&gt;
          &lt;job ref="cJob"/&gt;
      &lt;/step&gt;
  &lt;/job&gt;
  
   &lt;job id="aJob" xmlns="http://www.springframework.org/schema/batch"
           restartable="true" parent="baseJob"&gt;
      &lt;step id="aJobStep"&gt;
          &lt;tasklet ref="aJobTasklet" /&gt;
      &lt;/step&gt;
  &lt;/job&gt;
  
  &lt;job id="bJob" xmlns="http://www.springframework.org/schema/batch"
           restartable="true" parent="baseJob"&gt;
      &lt;step id="bJobStep"&gt;
          &lt;tasklet ref="bJobTasklet" /&gt;
      &lt;/step&gt;
  &lt;/job&gt;
  
  &lt;job id="cJob" xmlns="http://www.springframework.org/schema/batch"
           restartable="true" parent="baseJob"&gt;
      &lt;step id="cJobStep"&gt;
          &lt;tasklet ref="cJobTasklet" /&gt;
      &lt;/step&gt;
  &lt;/job&gt;
  </code></pre>
  
  <p>if Step <code>aStep</code> fails for job <code>someJob</code> (<code>aStep</code> has thrown some <code>SQLException</code>).
  Then <code>someJob</code> is continued to execute. But after successful completion of <code>cStep</code>, <code>BATCH_STATUS</code> for <code>someJob</code> is <code>COMPLETED</code> but <code>EXIT_STATUS</code> = <code>FAILED</code>.
  Also <code>BATCH_STATUS</code> and <code>EXIT_STATUS</code> of other steps are as follows.</p>
  
  <pre><code>Step Name BATCH_STATUS  EXIT_STATUS
  aStep     FAILED        FAILED
  bStep     COMPLETED     COMPLETED
  cStep     COMPLETED     COMPLETED
  </code></pre>