我使用Tomcat7作为vaadin项目的Web服务器//Eclipse作为编辑器。。它过去工作得很好,但昨天当我试图运行服务器时,我遇到了这个错误。。我试图删除服务器并创建一个新服务器。。但它不起作用
Caused by: java.lang.IllegalArgumentException: The servlets named [com.example.teamonelibraryapp_.Teamonelibraryapp_UI$Servlet] and [ui.AppMain$Servlet] are both mapped to the url-pattern [/*] which is not permitted
at org.apache.catalina.deploy.WebXml.addServletMapping(WebXml.java:293)
at org.apache.catalina.startup.ContextConfig.processAnnotationWebServlet(ContextConfig.java:2428)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2103)
at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2064)
at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2057)
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:5416)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 6 more
该跟踪中最重要的部分似乎是
The servlets named [com.example.teamonelibraryapp_.Teamonelibraryapp_UI$Servlet] and
[ui.AppMain$Servlet] are both mapped to the url-pattern [/*] which is not permitted
at org.apache.catalina.deploy.WebXml.addServletMapping(WebXml.java:293)
因此,将这些servlet映射到不同的url很可能会解决您的问题。