Regiser JacksonJsonProvider in Websphere liberty profile
<p>I am trying to call a REST service from an EJB hoping to utilize Jackson's </p>

<pre><code>@JsonIgnoreProperties(ignoreUnknown = true)
</code></pre>

<p>The following does the trick in wlp v8.5.5.9</p>

<pre><code>Client client = ClientBuilder.newClient().register(JacksonJsonProvider.class);
</code></pre>

<p>The same code produces a <code>NullPointerException</code> in the wlp v16.0.0.2</p>

<pre><code>Caused by: java.lang.NullPointerException
    at org.apache.cxf.jaxrs.impl.tl.ThreadLocalProviders.getContextResolver(ThreadLocalProviders.java:50)
    at org.codehaus.jackson.jaxrs.JacksonJsonProvider.locateMapper(JacksonJsonProvider.java:634)
    at org.codehaus.jackson.jaxrs.JacksonJsonProvider.readFrom(JacksonJsonProvider.java:413)
    at org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBodyReader(JAXRSUtils.java:1356)
    at org.apache.cxf.jaxrs.impl.ResponseImpl.doReadEntity(ResponseImpl.java:438)
    ... 98 more
</code></pre>

<p>I have found a <a href="https://m.ibm.com/https/developer.ibm.com/answers/questions/275628/liberty-jax-rs-20-client-unmarshalling-not-working.html?wirelessshow=2" rel="noreferrer">discussions</a> triggered by the same problems in v8.5.5.9, but I am not sure how it could help me. As I noted I have no troubles with the code in the v8.5.5.9</p>

<p>Another <a href="https://developer.ibm.com/answers/questions/253349/was-liberty-beta-2016-01-does-not-use-deployed-jac.html" rel="noreferrer">discussion</a> was related to the Jackson v2.x. Initially I used Jackson v1.9.13, but I have tried to switch to the newest Jeckson 2.8.0 version and apply the offered solution. The same outcome: application works in wlp 8.5.5.9 and produces the same error in v16.0.0.2.</p>

<p>Any ideas? </p>

<p><strong>Update:</strong>
the problem could be avoided by extending the JacksonJsonProvider class and explicitly providing object mapper </p>

<pre><code>public class MyJacksonJsonProvider extends JacksonJsonProvider {

        public MyJacksonJsonProvider() {
            ObjectMapper objectMapper = new ObjectMapper();
            objectMapper.setVisibilityChecker(objectMapper.getVisibilityChecker().withFieldVisibility(JsonAutoDetect.Visibility.ANY));
            objectMapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
            setMapper(objectMapper);
       }

}
</code></pre>

<p>and then registering it in the client </p>

<pre><code>Client client = ClientBuilder.newClient().register(MyJacksonJsonProvider.class);
</code></pre>

<p>However it would be nice to understand if it is a bug or a feature.</p>