title: How do I get Wildfly to use additional Jackson Datatypes?
body: <p>I'm getting this error</p>
  
  <pre><code>03:33:14,938 WARN  [org.jboss.resteasy.core.ExceptionHandler] (default task-1) Failed executing PUT /individual/5a247ce9-0a73-4373-89ce-e4177f911259/activities/432e6e5b-4185-462f-b57e-9ec04bec3d58: org.jboss.resteasy.spi.ReaderException: org.codehaus.jackson.map.JsonMappingException: Can not instantiate value of type [simple type, class java.time.Instant] from JSON String; no single-String constructor/factory method (through reference chain: com.lm.activity.DTOActivity["created"])
  </code></pre>
  
  <p>It's because Wildfly doesn't know how to handle an instant. By reading the error I could simply handle it in that class, but that seems silly. I'm using the following library and am shipping it and all of an updated jackson in my <code>war</code> file, but that alone isn't doing it.</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-core&lt;/artifactId&gt;
          &lt;version&gt;2.3.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
          &lt;version&gt;2.3.2&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&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.3.2&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>I found <a href="http://wiki.fasterxml.com/JacksonFAQJaxRs" rel="nofollow noreferrer">this wiki</a></p>
  
  <p>but my implementation is problematic, the class definition statement has an error</p>
  
  <pre><code>package com.lm.infrastructure;
  
  import static com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES;
  import com.fasterxml.jackson.databind.ObjectMapper;
  import javax.ws.rs.Produces;
  import javax.ws.rs.core.MediaType;
  import javax.ws.rs.ext.ContextResolver;
  import javax.ws.rs.ext.Provider;
  
  @Provider
  @Produces( MediaType.APPLICATION_JSON )
  public class JacksonProducer implements ContextResolver&lt;ObjectMapper&gt; {
  
      public JacksonProducer() throws Exception {
          this.json = new ObjectMapper()
                  .findAndRegisterModules()
                  .configure( FAIL_ON_UNKNOWN_PROPERTIES, false );
  
      }
  
      @Override
      public ObjectMapper getContext( Class&lt;?&gt; type ) {
          return json;
      }
      private final ObjectMapper json;
  }
  </code></pre>
  
  <p>I put this in my <code>web.xml</code> (not to be confused with <code>jboss-web.xml</code>)</p>
  
  <pre><code>&lt;web-app ...
    &lt;context-param&gt;
      &lt;param-name&gt;resteasy.providers&lt;/param-name&gt;
      &lt;param-value&gt;com.lm.infrastructure.JacksonProducer&lt;/param-value&gt;
    &lt;/context-param&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>I tried modifying <code>modules/system/layers/base/com/fasterxml/jackson/jaxrs/jackson-jaxrs-json-provider/main/module.xml</code> which seems to be suggested <a href="https://stackoverflow.com/q/21634020/206466">here</a></p>
  
  <pre><code> &lt;module xmlns="urn:jboss:module:1.1" name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider"&gt;
   &lt;resources&gt;
      &lt;resource-root path="jackson-jaxrs-json-provider-2.3.2.jar"/&gt;
      &lt;resource-root path="jackson-jaxrs-base-2.3.2.jar"/&gt;
      &lt;resource-root path="jackson-module-jaxb-annotations-2.3.2.jar"/&gt;
      &lt;resource-root path="jackson-databind-2.3.2.jar"/&gt;
      &lt;resource-root path="jackson-datatype-jsr310-2.3.2.jar"/&gt;
      &lt;!-- Insert resources here --&gt;
  &lt;/resources&gt;
  
  &lt;dependencies&gt;
      &lt;module name="javax.api"/&gt;
      &lt;module name="javax.ws.rs.api"/&gt;
      &lt;module name="javax.xml.bind.api"/&gt;
      &lt;module name="com.fasterxml.jackson.core.jackson-annotations"/&gt;
      &lt;module name="com.fasterxml.jackson.core.jackson-core"/&gt;
      &lt;module name="com.fasterxml.jackson.core.jackson-databind"/&gt;
      &lt;module name="com.fasterxml.jackson.datatype.jackson-datatype-jsr310"/&gt;
  &lt;/dependencies&gt;
  &lt;/module&gt;
  </code></pre>
  
  <p>My primary goal is to get jsr310 serializing and deserializing. What do I need to do to make this happen? but I suspect that the answer would apply to any additional datatype that doesn't ship with wildfly. (I think <a href="https://issues.jboss.org/browse/WFLY-2959" rel="nofollow noreferrer">this issue</a> is related )</p>