title: java.lang.IllegalStateException: [Assertion failed] - this state invariant must be true
body: <p>I'm using the same code from the <a href="http://www.mkyong.com/spring-batch/spring-batch-tasklet-example/" rel="nofollow">http://www.mkyong.com/spring-batch/spring-batch-tasklet-example/</a> (no custom implementation yet), but I've used all the current latest dependencies and found following issue. As I'm newbie to Spring-Batch does not able to track this issue</p>
  
  <p>Any quick help is much appreciated.</p>
  
  <p>The error I'm getting:</p>
  
  <pre><code>java.lang.IllegalStateException: [Assertion failed] - this state invariant must be true
      at org.springframework.util.Assert.state(Assert.java:385)
      at org.springframework.util.Assert.state(Assert.java:399)
      at com.mkyong.tasklet.FileDeletingTasklet.execute(FileDeletingTasklet.java:27)
      at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:406)
      at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:330)
      at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
      at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:271)
      at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:77)
      at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:368)
      at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:215)
      at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:144)
      at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:257)
      at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:198)
      at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:148)
      at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:64)
      at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:67)
      at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:165)
      at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:144)
      at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:134)
      at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:304)
      at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:135)
      at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50)
      at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:128)
      at com.mkyong.App.run(App.java:26)
      at com.mkyong.App.main(App.java:14)
  
  Apr 07, 2015 12:43:16 AM org.springframework.batch.core.launch.support.SimpleJobLauncher run
  INFO: Job: [FlowJob: [name=readMultiFileJob]] completed with the following parameters: [{}] and the following status: [FAILED]
  Exit Status : FAILED
  Exit Status : [java.lang.IllegalStateException: [Assertion failed] - this state invariant must be true]
  Done
  </code></pre>
  
  <p>The pom.xml for your reference:</p>
  
  <pre><code>&lt;properties&gt;
          &lt;jdk.version&gt;1.7&lt;/jdk.version&gt;
          &lt;spring.version&gt;4.1.6.RELEASE&lt;/spring.version&gt;
          &lt;spring.batch.version&gt;3.0.3.RELEASE&lt;/spring.batch.version&gt;
          &lt;mysql.driver.version&gt;5.1.35&lt;/mysql.driver.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;!-- Spring Core --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Spring Core --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-jdbc&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Spring Batch dependencies --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.batch&lt;/groupId&gt;
              &lt;artifactId&gt;spring-batch-core&lt;/artifactId&gt;
              &lt;version&gt;${spring.batch.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.batch&lt;/groupId&gt;
              &lt;artifactId&gt;spring-batch-infrastructure&lt;/artifactId&gt;
              &lt;version&gt;${spring.batch.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- MySQL database driver --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
              &lt;version&gt;${mysql.driver.version}&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  </code></pre>
  
  <p>On request, here is my xml file:</p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="
          http://www.springframework.org/schema/beans 
          http://www.springframework.org/schema/beans/spring-beans.xsd"&gt;
  
      &lt;!-- stored job-meta in memory --&gt; 
      &lt;bean id="jobRepository"
          class="org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean"&gt;
          &lt;property name="transactionManager" ref="transactionManager" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="transactionManager"
          class="org.springframework.batch.support.transaction.ResourcelessTransactionManager" /&gt;
  
      &lt;bean id="jobLauncher"
          class="org.springframework.batch.core.launch.support.SimpleJobLauncher"&gt;
          &lt;property name="jobRepository" ref="jobRepository" /&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>