title: Spring batch ItemListenerSupport ambiguous for the type when building the step
body: <p>I have spring job that read a file, process the data then write it in an oracle database. </p>
  
  <p>I'm having an issue when declaring my job, the error : </p>
  
  <p><strong>The method listener(Object) is ambiguous for the type SimpleStepBuilder&lt; Map&lt; String,Object >,Map&lt; String,Object >></strong></p>
  
  <p>I do not understand the error, why it is not using <code>listener(ItemListener..) method</code> . Any ideas ?</p>
  
  <p><strong>EDIT</strong> : Using separate listeners, having 3 objects implementing  <code>ItemWriteListener&lt;T&gt;</code>, <code>ItemReadListener&lt;T&gt;</code> and <code>ItemProcessorListener&lt;T,O&gt;</code> and building the step like that : </p>
  
  <pre><code>   //...
      .reader(/* custom ItemReader */)
      .listener(/* custom ItemReadListener&lt;T&gt; */)
      .listener(/* custom ItemWriterListener&lt;T&gt; */)
      .listener(/* custom ItemProcessorListener&lt;T,O&gt; */)
      //...
      .build(); 
  </code></pre>
  
  <p>The error disapear, but I still don't understand why it does not work with <code>ItemListenerSupport</code> class..</p>
  
  <p>Here is how my step is built : </p>
  
  <pre><code>    SimpleStepBuilder&lt;Map&lt;String, Object&gt;, Map&lt;String, Object&gt;&gt; stepBuilder = stepBuilderFactory
      .get("testStep")
      .&lt;Map&lt;String, Object&gt;, Map&lt;String, Object&gt;&gt;chunk(5000)
      .reader(/* custom ItemReader&lt;Map&lt;String, Object&gt;&gt; object */));
      .processor(/*custom ItemProcessor&lt;Map&lt;String, Object&gt;, Map&lt;String, Object&gt;&gt; object */))
      .writer(/*custom ItemWriter&lt;Map&lt;String,Object&gt; object */)
      .listener(new GenericItemListener&lt;Map&lt;String, Object&gt;, Map&lt;String, Object&gt;&gt;())
      .build();
  </code></pre>
  
  <p>Here is my custom <code>ItemListenerSupport</code> : </p>
  
  <pre><code>import java.util.List;
  import org.springframework.batch.core.listener.ItemListenerSupport;
  
  public class GenericItemListener&lt;I, R&gt; extends ItemListenerSupport&lt;I, R&gt; {
  
      @Override
      public void onReadError(Exception e) {
          //do something
      }
  
      @Override
      public void onWriteError(Exception e, List&lt;? extends R&gt; items) {
          //do something
      }
  
      @Override
      public void onProcessError(I items, Exception e) {
          //do something
      }
  }
  </code></pre>