升级后启动服务器时出现 Resteasy 错误。 "both mapped to the url-pattern [/RESTEASY_HttpServlet30Dispatcher] which is not permitted"

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

我将我所有的 resteasy 依赖项都更新到了更新的版本,但是现在,我在启动时总是遇到一个奇怪的错误 tomcat。

这些是我的依赖项:

    <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>

这是我在尝试启动服务器时遇到的错误:

    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

本来以为可能是依赖冲突的问题,结果我从maven中移除,重新下载,还是报错。它工作正常...

谢谢!

删除此依赖项:

<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