java.lang.ClassNotFoundException: in Apache TomEE when trying to use Jackson instead of Johnzon as JSON providerj

Starting from my original problem, I get that I need to specifically configure Apache TomEE to use Jackson as JSON provider (instead of the default Johnzon).

I imported the following in my pom.xml

    <dependency>         <!-- I only need this first one because otherwise it's ommited due to a conflict.... -->         <groupId>com.fasterxml.jackson.core</groupId>         <artifactId>jackson-databind</artifactId>         <version>2.9.9</version>     </dependency>     <dependency>         <groupId>com.fasterxml.jackson.jaxrs</groupId>         <artifactId>jackson-jaxrs-json-provider</artifactId>         <version>2.9.9</version>     </dependency> 

After this, I tried several ways:

Mentioning the provider in the ejb-jar.xml file

<pojo-deployment  class-name="jaxrs-application">     <properties>         cxf.jaxrs.providers = com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider     </properties> </pojo-deployment> 

Extending the JacksonJaxbJsonProvider with a custom class and registering it:

 @Provider  @Consumes(MediaType.APPLICATION_JSON)  @Produces(MediaType.APPLICATION_JSON)  public class TGJSONProvider extends JacksonJaxbJsonProvider {  } 

No matter what I do (or even if I don’t add anything, I have the same PROBLEM:

2019-05-31 16:11:35 SEVERE$  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(     ...     ...     at     at java.util.concurrent.ThreadPoolExecutor.runWorker(     at java.util.concurrent.ThreadPoolExecutor$     at Caused by: java.lang.ClassNotFoundException:     at     at java.lang.ClassLoader.loadClass(     at sun.misc.Launcher$  AppClassLoader.loadClass(     at java.lang.ClassLoader.loadClass(     ... 55 more 

What am I missing / doing wrong ?