The servlets named [X] and [Y] are both mapped to the url-pattern [/Z] which is not permitted
来源:互联网 发布:日本神钢造假 知乎 编辑:程序博客网 时间:2024/05/21 09:18
当我用myeclipse新建了一个servlet之后,重新运行tomcat,出现了如下错误
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/task02_2]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1247)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1897)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: The servlets named [UserServlet] and [servlet.UserServlet] are both mapped to the url-pattern [/UserServlet] which is not permitted
at org.apache.catalina.deploy.WebXml.addServletMapping(WebXml.java:293)
at org.apache.catalina.startup.ContextConfig.processAnnotationWebServlet(ContextConfig.java:2410)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2085)
at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2046)
at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2039)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1304)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:889)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:386)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5380)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
观察错误原因,发现是存在相同的映射,但是web.xml文件里只有一个映射。网上查了之后发现原来是新建servlet时myeclipse在对应的servlet里加了@WebServlet("/UserServlet")注解 这样就不用在web.xml里配置servlet的映射路径了,否则就会出现以上错误。
- tomcat报"The servlets named [x] and [y] are both mapped to the url-pattern[z] which is not permitted"
- The servlets named [X] and [Y] are both mapped to the url-pattern [/Z] which is not permitted
- The servlets named [x] and [y] are both mapped to the url-pattern [/JServlet] which is not permitted
- The servlets named [] and [] are both mapped to the url-pattern [/] which is not permitted
- J2EE的TOMCAT服务器报The servlets named [x] and [y] are both mapped to the url-pattern[z] which is not per
- The servlets named [A] and [B] are both mapped to the url-pattern [/servlet/]which is not permitted
- The servlets .. are both mapped to the url-pattern [/ControllerServlet] which is not permitted
- maven创建Web项目启动错误The servlets named [X] and [Y] are both mapped to the url-pattern [/DemoServlet]
- The servlets named [xxx] and [com.web.xxx] are both mapped to the url-pattern
- The servlets named [UserExit] and [com.fxh.control.UserExit] are both mapped to the url-pattern [/Us
- The servlets named [LogRecord] and [com.action.service.imp.LogServiceImp] are both mapped to the url
- MyEclispe启动Tomcat7时出现错误The servlets named [LoginServlet] and [com.liu.control.LoginServlet] are both
- 错误解决:The type [X] is not accessible due to restriction on required library [Y].
- INS-35354] The system on which you are attempting to install Oracle RAC is not part of a valid clust
- SVN E200009 which is not part of the commit; both sides of the move must be committed together
- The string "--" is not permitted within comments.
- the binary file '***.o' is not permitted
- The string "--" is not permitted within comments.
- 动态代理(JDK + cglib)
- ld: library not found for -lopencore-amrnb
- canvas学习笔记02
- logback 简介
- 云平台发现服务构建:为什么不使用ZooKeeper
- The servlets named [X] and [Y] are both mapped to the url-pattern [/Z] which is not permitted
- TensorFlow安装与测试
- 新的一年新的开始
- ubuntu14.04中安装opencv2.4.10
- 使用greenDao根据条件查询数据的时候碰到的问题
- HttpEntity的类型及其使用
- javamail 报 Received fatal alert handshake_failure
- 【32】Longest Valid Parentheses
- Git 初次使用(5)