title: FlatFileParseException Parsing error - Spring Batch
body: <p>I follow this <a href="https://spring.io/guides/gs/batch-processing/" rel="noreferrer">tutorial</a> and I'm getting <code>FlatFileParseException</code> error:</p>
  
  <blockquote>
    <p>org.springframework.batch.item.file.FlatFileParseException: Parsing
    error at line: 1 in resource=[class path resource [country.csv]],
    input=[AA,Aruba]</p>
  </blockquote>
  
  <p><code>country.csv</code></p>
  
  <pre><code>AA,Aruba
  BB,Baruba
  </code></pre>
  
  <p>and here is my <code>ItemReader</code> method</p>
  
  <pre><code>@Bean
      public ItemReader&lt;Country&gt; reader() {
          FlatFileItemReader&lt;Country&gt; reader = new FlatFileItemReader&lt;Country&gt;();
          reader.setResource(new ClassPathResource("country.csv"));
          reader.setLineMapper(new DefaultLineMapper&lt;Country&gt;() {{
              setLineTokenizer(new DelimitedLineTokenizer() {{
                  setNames(new String[] { "countryCode", "countryName" });
              }});
              setFieldSetMapper(new BeanWrapperFieldSetMapper&lt;Country&gt;() {{
                  setTargetType(Country.class);
              }});
          }});
          return reader;
      }
  </code></pre>
  
  <p>and <code>Country.java</code></p>
  
  <pre><code>@Entity
  @Table(name="Country")
  public class Country  {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = "id", nullable = false, updatable = false)
      Long id;
  
      @Column(name = "countryCode", nullable = false, updatable = false)
      String countryCode;
  
      @Column(name = "countryName", nullable = false, updatable = false)
      String countryName;
  
      public Country(String countryCode, String countryName) {
          this.countryCode = countryCode;
          this.countryName = countryName;
  
      }
  
      public Long getId() {
          return id;
      }
  
      public void setId(Long id) {
          this.id = id;
      }
  
      public String getCountryCode() {
          return countryCode;
      }
  
      public void setCountryCode(String countryCode) {
          this.countryCode = countryCode;
      }
  
      public String getCountryName() {
          return countryName;
      }
  
      public void setCountryName(String countryName) {
          this.countryName = countryName;
      }
  
      @Override
      public String toString() {
          return "countryCode: " + countryCode + ", countryName: " + countryName;
      }
  }
  </code></pre>