LINUX环境中tomcat启动错误:The servlets named X and Y are both mapped to the url-pattern [/Z] which is not p

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了LINUX环境中tomcat启动错误:The servlets named X and Y are both mapped to the url-pattern [/Z] which is not p相关的知识,希望对你有一定的参考价值。

  最近有一个问题困扰了我3天,我在windows部署项目无误后,准备将项目发布到阿里云linux服务器上,发现启动报错了:LINUX环境中tomcat启动错误:The servlets named X and Y are both mapped to the url-pattern [/Z] which is not permitted,首先想到的是肯定部署代码或者项目配置文件的事,怀疑有可能是jar包出错了,果不其然,在项目的WebContent\WEB-INF\lib发现了servlet-api.jar 果然删除再次部署。

  终于启动成功没有报错,当我满心欢喜打开主页的时候,发现不能跳转页面!!也就是说我的servlet失效了……这三天找了各种土方土法无果,终于发现了一篇文章(原谅我,我找不到原博文了……)解决了问题:因为项目中servlet采用了注解的方式,而在我的web.xml中,存在

<servlet>
<servlet-name>XXX</servlet-name>
<servlet-class>XXX</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>XXX</servlet-name>
<url-pattern>XXX</url-pattern>
</servlet-mapping>
<servlet>

的配置,所以才会报上面的错,将上面这种形式的代码全部注释,大功告成!









以上是关于LINUX环境中tomcat启动错误:The servlets named X and Y are both mapped to the url-pattern [/Z] which is not p的主要内容,如果未能解决你的问题,请参考以下文章

linux环境启动tomcat时报Neither the JAVA_HOME nor the JRE_HOME environment variable is defined 的解决方案

Linux下tomcat启动Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of

springboot放到linux启动报错:The temporary upload location [/tmp/tomcat.8524616412347407692.8111/work/

Tomcat启动失败【not found on the java.library.path】 错误信息如下【MyEclipse 10.0 -- jdk1.6.0_37】

Linux上的Tomcat地址映射,且404错误解决

启动Tomcat的startup.bat时一闪而过显示错误the catalina_home environment variable