Search code examples
tomcatjax-rsresteasytomcat10

What Maven Dependencies are necessary to run Resteasy version 4.x on Apache Tomcat version 10.x?


Unfortunately I was not able to find any information on how to run a Resteasy based application on Tomcat 10.x. I would appreciate if anybody could show me an example web.xml and pom.xml to make it work.


Solution

  • RESTeasy 4.x is an implementation of JAX-RS 2.0 and uses the javax.* namespace. Therefore it will not work with any Jakarta EE 9 server like Tomcat 10 (they use the jakarta.* package namespace).

    You have two solutions:

    • You can use a JAX-RS implementation compatible with Jakarta EE 9. At the moment this means Jersey 3.x,
    • Use the Tomcat migration tool to replace javax.* with jakarta.* in RESTeasy 4.x.