title: Spring Batch unable to read csv file
body: <p>I am new to Spring Batch and trying to execute this simple batch job, however it look like the csv file is not getting read, i am not getting any error, but the processor is not getting invoked. </p>
  
  <p>The sample-data.csv is already there in my class path/target directory. </p>
  
  <pre><code>package hello;
  
  import javax.sql.DataSource;
  
  import org.springframework.batch.core.Step;
  import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
  import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
  import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
  import org.springframework.batch.item.database.BeanPropertyItemSqlParameterSourceProvider;
  import org.springframework.batch.item.database.JdbcBatchItemWriter;
  import org.springframework.batch.item.database.builder.JdbcBatchItemWriterBuilder;
  import org.springframework.batch.item.file.FlatFileItemReader;
  import org.springframework.batch.item.file.builder.FlatFileItemReaderBuilder;
  import org.springframework.batch.item.file.mapping.BeanWrapperFieldSetMapper;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.context.annotation.Bean;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.core.io.ClassPathResource;
  
  @Configuration
  @EnableBatchProcessing
  public class BatchConfiguration {
  
      @Autowired
      JobBuilderFactory jobBuilderFactory;
  
      @Autowired
      StepBuilderFactory stepBuilderFactory;
  
      @Bean
      public FlatFileItemReader&lt;Person&gt; reader() {
          return new FlatFileItemReaderBuilder&lt;Person&gt;().name("personItemReader")
                  .resource(new ClassPathResource("sample-data.csv")).delimited()
                  .names(new String[] { "firstName", "lastName" })
                  .fieldSetMapper(new BeanWrapperFieldSetMapper&lt;Person&gt;() {
                      {
                          setTargetType(Person.class);
                      }
                  }).build();
      }
  
      @Bean
      public PersonItemProcessor processor() {
          return new PersonItemProcessor();
      }
  
      @Bean
      public JdbcBatchItemWriter&lt;Person&gt; writer(DataSource dataSource) {
          return new JdbcBatchItemWriterBuilder&lt;Person&gt;()
                  .itemSqlParameterSourceProvider(new BeanPropertyItemSqlParameterSourceProvider&lt;&gt;())
                  .sql("INSERT INTO people (first_name, last_name) VALUES (:firstName, :lastName)").dataSource(dataSource)
                  .build();
      }
  
      @Bean
      public Step step1(JdbcBatchItemWriter&lt;Person&gt; writer) {
          return stepBuilderFactory.get("step1").&lt;Person, Person&gt;chunk(10).reader(reader()).processor(processor())
                  .writer(writer).build();
      }
  }
  </code></pre>