resteasy错误“两者都Map到不允许的url模式[/resteasy\u httpservlet30dispatcher]

owfi6suc  于 2021-07-05  发布在  Java
关注(0)|答案(1)|浏览(454)

我将所有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中删除了它,并再次下载,错误仍在继续。它正常工作。。。
谢谢!

bnl4lu3b

bnl4lu3b1#

删除此依赖项:

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

resteasy3中的resteasyjaxrs和resteasy客户机模块包含大多数框架类,在什么是内部实现细节和什么是供公共使用之间没有真正的界限。在wildfly中,这些模块中的工件档案也包含在公共模块中。考虑到公共模块的完全向后兼容性的共同期望,为了更容易地进行项目演化和维护,在resteasy 4.0.0.final中,这些大组件被拆分如下:
resteasy文档:https://docs.jboss.org/resteasy/docs/4.5.6.final/userguide/html/migration_from_older_versions.html

相关问题