Renan Geraldo
Renan Geraldo

Reputation: 655

Resteasy error when starting server after upgrading. "both mapped to the url-pattern [/RESTEASY_HttpServlet30Dispatcher] which is not permitted"

I updated all my resteasy dependencies to newer versions, but now, I am always getting a strange error when starting tomcat.

These are my dependencies:

    <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-jaxrs</artifactId>
        <version>3.13.0.Final</version>
    </dependency>
    <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-servlet-initializer</artifactId>
        <version>4.5.6.Final</version>
    </dependency>
    <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-multipart-provider</artifactId>
        <version>4.5.6.Final</version>
    </dependency>
    <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-cache-core</artifactId>
        <version>4.5.6.Final</version>
    </dependency>

This is the error I am getting when I try to start the server:

    Caused by: java.lang.IllegalArgumentException: The servlets named [org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher] and [org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher] are both mapped to the url-pattern [/RESTEASY_HttpServlet30Dispatcher] which is not permitted
    at org.apache.tomcat.util.descriptor.web.WebXml.addServletMappingDecoded(WebXml.java:339)
    at org.apache.tomcat.util.descriptor.web.WebXml.merge(WebXml.java:1634)
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1148)
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:776)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5063)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    ... 43 more

I was thinking that it could be something related to conflicts in the dependencies, but I removed from maven and downloaded again and the error continued. It was working normally...

Thanks!

Upvotes: 2

Views: 1446

Answers (1)

Daniel Felgar
Daniel Felgar

Reputation: 66

Remove this dependency:

<dependency>
   <groupId>org.jboss.resteasy</groupId>
   <artifactId>resteasy-jaxrs</artifactId>
   <version>3.13.0.Final</version>
</dependency>

The resteasy-jaxrs and resteasy-client modules in RESTEasy 3 contain most of the framework classes and there's no real demarcation between what is internal implementation detail and what is for public consumption. In WildFly, the artifact archives from those modules are also included in a public module. Given the common expectation of full backward compatibility of whatever comes from public modules, to allow for easier project evolution and maintenance, in RESTEasy 4.0.0.Final those big components have been split as follows:

Resteasy documentation: https://docs.jboss.org/resteasy/docs/4.5.6.Final/userguide/html/Migration_from_older_versions.html

Upvotes: 4

Related Questions