title: java.lang.ClassNotFoundException: javax.ws.rs.ext.MessageBodyReader in Apache TomEE when trying to use Jackson instead of Johnzon as JSON provider
body: <p>Starting from <a href="https://stackoverflow.com/questions/56359380/jsonserialize-jsondeserialize-not-working-in-apache-tomcat-tomee">my original problem</a>, I get that I need to specifically configure Apache TomEE to use Jackson as JSON provider (instead of the default Johnzon).</p>
  
  <p>I imported the following in my pom.xml</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;!-- I only need this first one because otherwise it's ommited due to a conflict.... --&gt;
          &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
          &lt;version&gt;2.9.9&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.fasterxml.jackson.jaxrs&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-jaxrs-json-provider&lt;/artifactId&gt;
          &lt;version&gt;2.9.9&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>After this, I tried several ways:</p>
  
  <p>Mentioning the provider in the <em>ejb-jar.xml</em> file</p>
  
  <pre><code>&lt;pojo-deployment  class-name="jaxrs-application"&gt;
      &lt;properties&gt;
          cxf.jaxrs.providers = com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider
      &lt;/properties&gt;
  &lt;/pojo-deployment&gt;
  </code></pre>
  
  <p>Extending the JacksonJaxbJsonProvider with a custom class and registering it:</p>
  
  <pre><code> @Provider
   @Consumes(MediaType.APPLICATION_JSON)
   @Produces(MediaType.APPLICATION_JSON)
   public class TGJSONProvider extends JacksonJaxbJsonProvider {
   }
  </code></pre>
  
  <p><strong>No matter what I do (or even if I don't add anything, I have the same PROBLEM:</strong></p>
  
  <pre><code>2019-05-31 16:11:35 SEVERE org.apache.openejb.observer.ObserverManager$MethodInvocation invoke error invoking org.apache.tomee.webservices.TomeeJaxRsService@12bfd80d
  java.lang.NoClassDefFoundError: javax/ws/rs/ext/MessageBodyReader
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
      ...
      ...
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
  Caused by: java.lang.ClassNotFoundException: javax.ws.rs.ext.MessageBodyReader
      at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      ... 55 more
  </code></pre>
  
  <p>What am I missing / doing wrong ?</p>
  
  <p>Thanks.</p>