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

huangapple go评论78阅读模式
英文:

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: 名为 [org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher] 和 [org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher] 的Servlet均映射到了不允许的url-pattern [/RESTEASY_HttpServlet30Dispatcher]
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中删除并重新下载,错误仍然存在。之前一切正常...

谢谢!

英文:

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:

    &lt;dependency&gt;
        &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
        &lt;artifactId&gt;resteasy-jaxrs&lt;/artifactId&gt;
        &lt;version&gt;3.13.0.Final&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
        &lt;artifactId&gt;resteasy-servlet-initializer&lt;/artifactId&gt;
        &lt;version&gt;4.5.6.Final&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
        &lt;artifactId&gt;resteasy-multipart-provider&lt;/artifactId&gt;
        &lt;version&gt;4.5.6.Final&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
        &lt;artifactId&gt;resteasy-cache-core&lt;/artifactId&gt;
        &lt;version&gt;4.5.6.Final&lt;/version&gt;
    &lt;/dependency&gt;

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!

答案1

得分: 4

删除此依赖项:

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



&gt; RESTEasy 3 中的 resteasy-jaxrs 和 resteasy-client 模块包含大部分框架类,并且在内部实现细节和公共使用部分之间没有真正的区分。在 WildFly 中,这些模块的构件存档也包含在一个公共模块中。考虑到公共模块的所有内容都有完全向后兼容的共同期望,为了更容易地进行项目演进和维护,在 RESTEasy 4.0.0.Final 中,这些重要组件已经拆分如下:
&gt; 
&gt; Resteasy 文档:
https://docs.jboss.org/resteasy/docs/4.5.6.Final/userguide/html/Migration_from_older_versions.html
英文:

Remove this dependency:

&lt;dependency&gt;
   &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
   &lt;artifactId&gt;resteasy-jaxrs&lt;/artifactId&gt;
   &lt;version&gt;3.13.0.Final&lt;/version&gt;
&lt;/dependency&gt;

> 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

huangapple
  • 本文由 发表于 2020年9月5日 05:15:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/63748105.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定