title: org.apache.catalina.LifecycleException tomcat error
body: <p>My log of error on eclipse</p>
  
  <pre><code>Dec 07, 2013 12:52:11 PM org.apache.catalina.startup.HostConfig deployWAR
  INFO: Deploying web application archive C:\apache-tomcat-7.0.42\ROOT\QMSa.war
  Dec 07, 2013 12:52:19 PM org.apache.catalina.core.ContainerBase addChildInternal
  SEVERE: ContainerBase.addChild: start: 
  org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/QMSa]]
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
      at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:976)
      at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1653)
      at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      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: java.lang.IllegalArgumentException: The servlets named [uploadServlet] and [FileUploadDBServlet.FileUploadDBServlet] are both mapped to the url-pattern [/uploadServlet] which is not permitted
      at org.apache.catalina.deploy.WebXml.addServletMapping(WebXml.java:335)
      at org.apache.catalina.startup.ContextConfig.processAnnotationWebServlet(ContextConfig.java:2450)
      at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2132)
      at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2093)
      at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2086)
      at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1293)
      at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
      at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:376)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
      at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5322)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      ... 10 more
  
  Dec 07, 2013 12:52:19 PM org.apache.catalina.startup.HostConfig deployWAR
  SEVERE: Error deploying web application archive C:\apache-tomcat-7.0.42\ROOT\QMSa.war
  java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/QMSa]]
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:904)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
      at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:976)
      at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1653)
      at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      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)
  </code></pre>
  
  <p>I deployed my WAR file in the webapps folder.
  And on eclipse I got this error.</p>
  
  <p>I am using the same version of JRE for tomcat and eclipse.
  Also this is my web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;!--
   Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  --&gt;
  
  &lt;web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    version="2.5"&gt;
  
    &lt;display-name&gt;Welcome to Tomcat&lt;/display-name&gt;
    &lt;description&gt;
  hello
    &lt;/description&gt;
   &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
  
   &lt;servlet&gt;
     &lt;servlet-name&gt;uploadServlet&lt;/servlet-name&gt;
     &lt;servlet-class&gt;FileUploadDBServlet.FileUploadDBServlet&lt;/servlet-class&gt;
   &lt;/servlet&gt;
  
   &lt;servlet-mapping&gt;
     &lt;servlet-name&gt;uploadServlet&lt;/servlet-name&gt;
     &lt;url-pattern&gt;/uploadServlet&lt;/url-pattern&gt;
   &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>from the index.html page I send a form.The action for the form is given by</p>
  
  <pre><code>&lt;form method="post" name="myForm" id="question_form" action="uploadServlet" enctype="multipart/form-data" onsubmit="return validateForm()" &gt;
  </code></pre>
  
  <p>please provide help</p>
  
  <p><strong>UPDATE</strong></p>
  
  <pre><code>@WebServlet("/uploadServlet")
  @MultipartConfig(maxFileSize = 16177215)    // upload file's size up to 16MB
  public class FileUploadDBServlet extends HttpServlet {
  
      // database connection settings
      private String dbURL = "jdbc:mysql://localhost:3306/elect";
      private String dbUser = "root";
      private String dbPass = "root";
  
      protected void doPost(HttpServletRequest request,
              HttpServletResponse response) throws ServletException, IOException {
          // gets values of text fields
  </code></pre>