title: Java 8 LocalDate conversion with Jackson does not work
body: <p>I am facing one very known issue yet no solution is working for me. Any quick help will be grateful.</p>
  
  <p>From MVC controller, I am calling REST service which returns me Model object with <code>LocalDate</code> as one of the fields.  <code>JacksonJAXbJSONProvider</code>  does not parse the <code>Localdate</code> object. I wrote custom Mapper as below And dependency is added in <code>pom.xml</code>. Other required dependencies are also added(jackson databind, core, annotation)</p>
  
  <pre><code>&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>Custom <code>ObjectMapper</code> class :</p>
  
  <pre><code>public class LocalDateObjectMapperContextResolver extends ObjectMapper{
      @Provider
      public LocalDateObjectMapperContextResolver() {
  
         registerModule(new JavaTimeModule());
         //findAndRegisterModules();
         configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
      }
  
  }
  </code></pre>
  
  <p>This was suggested in <a href="https://stackoverflow.com/questions/28802544/java-8-localdate-jackson-format/38051405#38051405">Java 8 LocalDate Jackson format</a></p>
  
  <p>My spring.xml(contains configuration for MVC controller etc...) has already one mapper configured which does conversion automatically as below</p>
  
  <pre><code>&lt;mvc:annotation-driven&gt;
      &lt;mvc:message-converters&gt;
          &lt;bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter" 
              p:objectMapper-ref="myobjectMapper"/&gt;
          &lt;bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter" 
              p:objectMapper-ref="objectMapper"/&gt;
      &lt;/mvc:message-converters&gt;
  &lt;/mvc:annotation-driven&gt;
  
  &lt;bean id="objectMapper" class="org.codehaus.jackson.map.ObjectMapper"/&gt;
  &lt;bean id="myobjectMapper" class="mypackage.LocalDateObjectMapperContextResolver"/&gt;
  </code></pre>
  
  <p>Below is stub file which connects to REST Service. I also tried to provide provider as below after above didnot work, but no luck here too.</p>
  
  <pre><code>&lt;jaxrs:client id="testclient"
      serviceClass="package1.RESTService"
      username="abc"
      password="abc"
      address="$serviceURL"&gt;
  
      &lt;jaxrs:features&gt;
          &lt;bean class="org.apache.cxf.transport.common.gzip.GZIPFeature"/&gt;
          &lt;cxf:logging/&gt;
      &lt;/jaxrs:features&gt;
  
      &lt;jaxrs:providers&gt;
          &lt;bean class="org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider"/&gt;
          &lt;bean class="mypackage.LocalDateObjectMapperContextResolver"/&gt;
      &lt;/jaxrs:providers&gt;
  
  &lt;/jaxrs:client&gt; 
  </code></pre>
  
  <p>Now How do I configure my Context resolver which I just wrote so that I should be able to convert LocalDate.</p>
  
  <p>What Am I doing wrong ?</p>
  
  <p>I am getting below exception </p>
  
  <pre><code>No suitable constructor found for type [simple type, class java.time.LocalDate]: can not instantiate from JSON object (need to add/enable type information?)
  </code></pre>