title: How to pass a String (Non managed bean) to a managed bean
body: <p>I have a spring batch job. There is a step that is calling the reader method.</p>
  
  <p><strong>STEP</strong></p>
  
  <pre><code>@Bean public Step myStep(FlatFileItemWriter&lt;String&gt; writer, Processor
  processor,  @Value("${com.tableName}") String myTableName) {
      return stepBuilderFactory.get("step1")
          .&lt;MyBean, String&gt; chunk(this.chuckSize)
          .reader(reader(myTableName, this.myRowMapper))
          .processor(processor)
          .writer(writer)
          .build(); 
  }
  </code></pre>
  
  <p><strong>READER</strong> <em>Working</em></p>
  
  <pre><code>@Bean
  public &lt;T&gt; JdbcCursorItemReader&lt;T&gt; reader(@Value("${com.tableName}") String tableName, RowMapper&lt;T&gt; rowMapper) {
      JdbcCursorItemReader&lt;T&gt; jdbcCursorItemReader = new JdbcCursorItemReader&lt;&gt;();
      String query = "select * from " + tableName;
      jdbcCursorItemReader.setDataSource(dataSource);
      jdbcCursorItemReader.setSql(query);
      jdbcCursorItemReader.setRowMapper(rowMapper);
  
      return jdbcCursorItemReader;
  }
  </code></pre>
  
  <p>I want my reader to take dynamic tableNames. So I changed the reader to as mentioned below. </p>
  
  <pre><code>@Bean
  public &lt;T&gt; JdbcCursorItemReader&lt;T&gt; reader(String tableName, RowMapper&lt;T&gt; rowMapper) {
      JdbcCursorItemReader&lt;T&gt; jdbcCursorItemReader = new JdbcCursorItemReader&lt;&gt;();
      String query = "select * from " + tableName;
      jdbcCursorItemReader.setDataSource(dataSource);
      jdbcCursorItemReader.setSql(query);
      jdbcCursorItemReader.setRowMapper(rowMapper);
  
      return jdbcCursorItemReader;
  }
  </code></pre>
  
  <p>This cause the following error.  </p>
  
  <pre><code>***************************
  APPLICATION FAILED TO START
  ***************************
  
  Description:
  
  Parameter 0 of method reader in com.walgreens.oracleextractionbatch.OracleExtractionJobConfiguration required a bean of type 'java.lang.String' that could not be found.
  
  
  Action:
  
  Consider defining a bean of type 'java.lang.String' in your configuration.
  </code></pre>
  
  <p>I tried so many workarounds after intense googling. But I think I am missing something basic. Please help. TIA</p>