今天运行服务器报以下错恶:
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/weiXinDevelop]]
at java.util.concurrent.FutureTask.report(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1119)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:819)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
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: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/weiXinDevelop]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
... 6 more
Caused by: java.lang.IllegalArgumentException: The servlets named [WeiXinTest] and [kang.test.WeiXinTest] are both mapped to the url-pattern [/weixin] which is not permitted
at org.apache.catalina.deploy.WebXml.addServletMapping(WebXml.java:293)
at org.apache.catalina.startup.ContextConfig.processAnnotationWebServlet(ContextConfig.java:2460)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2135)
at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2096)
at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2088)
at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2088)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1302)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:887)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:387)
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:5503)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
... 6 more
下截图:
找了错误:
1.看下是否jre版本太低造成
2.清除tomcat缓存
3.看报错日志的caused by原因(重要)
我这里找了下发现原因在代码中的@WebServlet标签和web.xml中的配置重复了(蓝色那行)
当我选择其中一个运行tomcat,发现成功运行了!!