OffsetDateTime with Spring Data Couchbase
<p>I am creating a POC using Spring Data Couchbase and running into a slight issue with the new Java 8 DateTime Libraries. I would like my content to be saved and read with ISO-8601 dates. I am using OffsetDateTime to capture the full timestamp with timezone offset. When saving a document I have no issues. However, when reading it from the DB I receive a Mapping Exception. I am using the JSR-310 dependency to configure jackson parsing as well. </p>

<p>Is using OffsetDateTime the right approach? Should I fall back and just use Joda DateTime? </p>

<p>POM Dependencies: </p>

<pre><code> &lt;dependency&gt;
    &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
    &lt;artifactId&gt;spring-data-couchbase&lt;/artifactId&gt;
    &lt;version&gt;2.1.1.RELEASE&lt;/version&gt;
 &lt;/dependency&gt;

 &lt;dependency&gt;
     &lt;groupId&gt;com.fasterxml.jackson.datatype&lt;/groupId&gt;
     &lt;artifactId&gt;jackson-datatype-jsr310&lt;/artifactId&gt;
     &lt;version&gt;2.6.1&lt;/version&gt;
 &lt;/dependency&gt;
</code></pre>

<p>Document Java Class: </p>

<pre><code>@Document
public class Content {

    @Id
    private Long id;

    @CreatedDate
    private OffsetDateTime createdDate;
...
}
</code></pre>

<p>Application YML: </p>

<pre><code>spring:
  jackson:
    deserialization:
      adjust_dates_to_context_time_zone: false
    serialization:
      write_dates_as_timestamps: false
    date-format: yyyy-MM-dd'T'HH:mm:ss.SSSZ
</code></pre>

<p>On Save (No Issue): </p>

<pre><code>{
    ...
    "createdDate": "2016-06-14T15:25:27.746-04:00",
    ...
}
</code></pre>

<p>On Read (Exception): </p>

<pre><code>{
  "timestamp": "2016-06-14T19:26:08.290+0000",
  "status": 500,
  "error": "Internal Server Error",
  "exception": "org.springframework.data.mapping.model.MappingException",
  "message": "No property null found on entity class java.time.OffsetDateTime to bind constructor parameter to!",
  "path": "/v1/content/a7d078f1-a0d5-4ec1-89f5-149d850aa372"
}
</code></pre>