This question already has answers here:
java.lang.IllegalArgumentException: The servlets named [X] and [Y] are both mapped to the url-pattern [/url] which is not permitted
                                
                                    (6个答案)
                                
                        
                                3年前关闭。
            
                    
Caused by: java.lang.IllegalArgumentException: The servlets named [JavaQuestionForm] and [JavaQuestion] are both mapped to the url-pattern [/JavaQuestion] which is not permitted
    at org.apache.catalina.deploy.WebXml.addServletMapping(WebXml.java:293)
    at org.apache.catalina.startup.ContextConfig.processAnnotationWebServlet(ContextConfig.java:2443)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2118)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsJndi(ContextConfig.java:2041)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1948)
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1311)
    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:5479)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 6 more

最佳答案

如异常所言,您尝试将2个不同的servlet绑定到相同的URI:

The servlets named [JavaQuestionForm] and [JavaQuestion] are both mapped to the url-pattern [/JavaQuestion] which is not permitted


您必须更改您的web.xml

08-28 19:38