1

I have no idea whats happening im just coding my stuff in eclipse and now the server wont start. any ideas? i tried deleting the snap thing in the directory but no luck . i have no idea what to do please help i have a project due later and im not done yet. i've tried googling believe me. :(

Caused by: java.lang.IllegalArgumentException: The servlets named [servlets.AddServlet] and [servlets.AddSubjectDetailsServlet] are both mapped to the url-pattern [/AddSubjectDetailsServlet] which is not permitted
    at org.apache.tomcat.util.descriptor.web.WebXml.addServletMapping(WebXml.java:308)
    at org.apache.catalina.startup.ContextConfig.processAnnotationWebServlet(ContextConfig.java:2342)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2024)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:1918)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:1913)
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1139)
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:771)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:305)
    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:5066)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 6 more
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
jeeeee
  • 229
  • 1
  • 5
  • 18

1 Answers1

3

The problem is with your application, more precisely in your web.xml file. If you search for the following string:

/AddSubjectDetailsServlet

You will find two occurences of it. This is what Tomcat complains about:

The servlets named [servlets.AddServlet] and [servlets.AddSubjectDetailsServlet] are both mapped to the url-pattern [] which is not permitted

Basically you are mapping two servlets to the same URL, so Tomcat would have no chance to route requests properly. You need to change one of them to something else.

Gergely Bacso
  • 14,243
  • 2
  • 44
  • 64
  • I had the similar problem. But in my case the duplicity was not directly in my files but it came from a jar which I was depending up on. Then I did a grep --include=\* -r "servlet name " . in the webapps directory and found that there are two jars using the servlet name. I removed one among them and that solved the issue. – nantitv Nov 26 '18 at 11:06
  • I had to replaced MyServlet name in the web.xml. I added "2" as MyServet2. i also needed to change the name to MyServlet2 from all my jsp files. For some reason when i did move MyServlet to another folder, eclipse still think it still belongs there. – Supercoder Nov 22 '20 at 22:01