I get the above error when I'm trying to start the server. Important note, for any other Web Apps the server starts just fine. It's just this particular Web App that does not work. Here is the complete stack trace:

Caused by: java.lang.IllegalArgumentException: The servlets named [DOMServlet] and [edu.unsw.comp9321.DOMServlet] are both mapped to the url-pattern [/DOMServlet] 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.processAnnotationsFile(ContextConfig.java:2057)
    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:5412)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 7 more
1

There are 1 answers

2
Alejandro Agapito Bautista On BEST ANSWER

Hello You should check your web.xml file because you have 2 servlets DOMServlet and edu.unsw.comp9321.DOMServlet refering to the same url-pattern, if you are not mapping the servlets in the web.xml check in your code the classes anotated with @WebServlet.

other important point is that maybe you have a deployed another application which contains the DOMServlet in your tomcat directory, check your webapps directory and clean that to ensure that you don't have additional wars with duplicated url-patterns. and well maybe you can give us additional information to try to help you.

Cheers