title: Spring-batch fails on MultiResourceItemReader
body: <p>I'm trying to create a job that will process files that were saved by a previous step.</p>
  
  <p>The job definition looks like:</p>
  
  <pre><code>&lt;bean id="downloadCatalogTasklet" class="DownloadCatalogTasklet" scope="step" /&gt;
  
  &lt;bean id="customItemReader" class="CustomItemReader" scope="step"/&gt;
  
  &lt;bean id="itemWriter" class="NoOpItemWriter" scope="step"/&gt;
  
  &lt;bean id="multiResourceReader" class="org.springframework.batch.item.file.MultiResourceItemReader" scope="step"&gt;
          &lt;property name="strict" value="true" /&gt;
          &lt;property name="resources" value="file://C:/temp/unzipped/*.txt" /&gt;
          &lt;property name="delegate" ref="customItemReader" /&gt;
      &lt;/bean&gt;
  
  &lt;batch:job id="importCatalog"&gt;
     &lt;batch:step id="downloadCatalog"&gt;
        &lt;batch:tasklet ref="downloadCatalogTasklet" /&gt;
        &lt;batch:next on="COMPLETED" to="processCatalog" /&gt;
        &lt;batch:fail on="FAILED"/&gt;
     &lt;/batch:step&gt;
     &lt;batch:step id="processCatalog"&gt;
        &lt;batch:tasklet&gt;
           &lt;batch:chunk reader="multiResourceReader" writer="itemWriter" commit-interval="1" /&gt;
        &lt;/batch:tasklet&gt;
     &lt;/batch:step&gt;
  &lt;/batch:job&gt;
  </code></pre>
  
  <p>The fist step is working fine. The catalog is downloaded and unzipped properly. But, when spring batch tries to execute the step <strong>processCatalog</strong>, it throws the following error (just):</p>
  
  <pre><code>2016-08-23 09:45:31 ERROR AbstractStep:229 - Encountered an error executing step processCatalog in job importCatalog
  java.lang.IllegalArgumentException: Name must be assigned for the sake of defining the execution context keys prefix.
      at org.springframework.util.Assert.hasText(Assert.java:162)
      at org.springframework.batch.item.util.ExecutionContextUserSupport.getKey(ExecutionContextUserSupport.java:59)
      at org.springframework.batch.item.ItemStreamSupport.getExecutionContextKey(ItemStreamSupport.java:71)
      at org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader.update(AbstractItemCountingItemStreamItemReader.java:183)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
      at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
      at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
      at com.sun.proxy.$Proxy7.update(Unknown Source)
      at org.springframework.batch.item.file.MultiResourceItemReader.update(MultiResourceItemReader.java:209)
  </code></pre>
  
  <p>This is the first time that I use MultiResourceItemReader. I dont't know if I'm missing something. I'm using spring-batch 3.0.7, with java 1.7.</p>
  
  <p>It seems that I should assign a name to the ExecutionContext, but I don't know how to do it.</p>