title: Cannot construct instance of java.time.LocalDateTime - Jackson
body: <p>I have two Spring Boot applications which communicate through JMS Messaging and ActiveMQ. </p>
  
  <p>One app sends to the other app an object which contains a LocalDateTime property. This object is serialized to JSON in order to be sent to the other application. </p>
  
  <p>The problem I'm facing is that Jackson is not able to deserialize the LocalDateTime property when it's trying to map the incoming json to my object. The LocalDateTime property has the following format when it arrives to the "listener app":</p>
  
  <pre><code>"lastSeen":{
    "nano":0,
    "year":2019,
    "monthValue":4,
    "dayOfMonth":8,
    "hour":15,
    "minute":6,
    "second":0,
    "month":"APRIL",
    "dayOfWeek":"MONDAY",
    "dayOfYear":98,
    "chronology":{
      "id":"ISO",
      "calendarType":"iso8601"
    }
  }
  </code></pre>
  
  <p>The exception I'm getting is the following:</p>
  
  <p><code>org.springframework.jms.support.converter.MessageConversionException: Failed to convert JSON message content; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of java.time.LocalDateTime</code></p>
  
  <p>I was able to fix this issue temporarily by using the following annotations:</p>
  
  <pre><code>@JsonSerialize(as = LocalDateTimeSerializer.class)
  @JsonDeserialize(using = LocalDateTimeDeserializer.class, as = LocalDateTime.class)
  private LocalDateTime lastSeen;
  </code></pre>
  
  <p>but they belong to <a href="https://github.com/FasterXML/jackson-datatype-jsr310" rel="nofollow noreferrer">jackson datatype jsr310</a> which is now <strong>DEPRECATED</strong>.</p>
  
  <p>Is there any way/alternative to deserialize this LocalDateTime property without using the above annotations? Or how do I get this to work using the recommended <a href="https://github.com/FasterXML/jackson-modules-java8" rel="nofollow noreferrer">jackson-modules-java8</a>?</p>