title: JSON parse error: Can not deserialize value
body: <p>I have the below error when trying to create arraylist of an entity - 'timelog'.</p>
  
  <pre><code>{
      "timestamp": 1519372691473,
      "status": 400,
      "error": "Bad Request",
      "exception": "org.springframework.http.converter.
                    HttpMessageNotReadableException",
      "message": "JSON parse error: Can not deserialize value of type 
                  java.time.LocalDate from String \"02-17-2018\": Text '02-17-
                  2018' could not be parsed at index 0; nested exception is 
                  com.fasterxml.jackson.databind.exc.InvalidFormatException: 
                  Can not deserialize value of type java.time.LocalDate from 
                  String \"02-17-2018\": Text '02-17-2018' could not be parsed 
                  at index 0\n at [Source: 
                  java.io.PushbackInputStream@83d3114; line: 3, column: 14] 
                  (through reference chain: java.util.ArrayList[0] 
                  &gt;com.timesheet.model.Timelog[\"logDate\"])",
      "path": "/employee/101/timelog/tabdata"
  }
  </code></pre>
  
  <p>I am sending a set of entity records through'post'method.I am getting error on executing the request body.</p>
  
  <pre><code>@RequestMapping(path = "employee/{id}/timelog/tabdata", method = 
  RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
  public void timeLogging(@RequestBody ArrayList&lt;Timelog&gt; tabData, 
  @PathVariable("id") Integer id) {
      //Employee e = employeeRepository.findOne(id);
      //tabData.forEach(log -&gt; {
      //log.setEmployee(e);
      //timeLogRepository.save(log);
      //});
  
      }
  </code></pre>
  
  <p>In my entity I am using  a localdatedeserializer:
  Timelog entity code:</p>
  
  <pre><code>@Entity
  @Table(name = "timelog", catalog = "timesheet")
  public class Timelog implements java.io.Serializable {
  
      private static final long serialVersionUID = 1871977717947082854L;
      private Integer id;
      @JsonIgnore
      private Employee employee;
  
      @JsonDeserialize(using = LocalDateDeserializer.class)
      private LocalDate logDate;
      private String project;
      private Float timetaken;
  </code></pre>
  
  <p>//code for LocalDateDeserializer</p>
  
  <pre><code>public class LocalDateDeserializer extends JsonDeserializer&lt;LocalDate&gt; {
      public static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("MM-dd-yyyy");
  
      @Override
      public LocalDate deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
          return LocalDate.parse(p.getValueAsString(), FORMATTER);
      }
  }
  </code></pre>
  
  <p>Can anyone help to identify why the localdatedeserializer is not been effective.Thanks in advance.</p>