LocalDateTime - deserialization with LocalDateTime.parse
<p>I have the field <code>initiationDate</code> which serialises by <code>ToStringSerializer</code> class to ISO-8601 format.</p>

<pre><code>@JsonSerialize(using = ToStringSerializer.class)
private LocalDateTime initiationDate;
</code></pre>

<p>When I receive the following JSON,</p>

<pre><code>...
"initiationDate": "2016-05-11T17:32:20.897",
...
</code></pre>

<p>I want to deserialize it by <code>LocalDateTime.parse(CharSequence text)</code> factory method. All my attempts ended with <code>com.fasterxml.jackson.databind.JsonMappingException</code>:</p>

<blockquote>
  <p>Can not instantiate value of type [simple type, class <code>java.time.LocalDateTime</code>] from <code>String</code> value (<code>'2016-05-11T17:32:20.897'</code>); no single-<code>String</code> constructor/factory method</p>
</blockquote>

<p>How do I achieve that? How can I specify factory method?</p>

<hr>

<p>EDIT: </p>

<p>The problem has been solved by including  <a href="https://github.com/FasterXML/jackson-datatype-jsr310" rel="noreferrer">jackson-datatype-jsr310 module</a> to the project and using <code>@JsonDeserialize</code> with <code>LocalDateTimeDeserializer</code>.</p>

<pre><code>@JsonSerialize(using = ToStringSerializer.class)
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
private LocalDateTime initiationDate;
</code></pre>