title: Can't start application on Tomcat8 due to exception org.apache.catalina.LifecycleException?
body: <p>I copy my folder (myApp) into webapps folder of Tomcat8.</p>
  
  <p>Then I went to "Tomcat Web Application Manager" &amp; I saw "/myApp" running=false there. Then I clicked Start &amp; found this error:</p>
  
  <pre><code>FAIL - Application at context path /myApp could not be started
  FAIL - Encountered exception org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/myApp]]
  </code></pre>
  
  <p>Before that, a guy in Youtube instructed to modify tomcat8/conf/tomcat-users.xml like this:</p>
  
  <pre><code> &lt;?xml version='1.0' encoding='utf-8'?&gt;
  &lt;tomcat-users&gt;
  
    &lt;role rolename="manager-gui"/&gt;
    &lt;role rolename="manager-script"/&gt;
    &lt;role rolename="manager-jmx"/&gt;
    &lt;role rolename="manager-status"/&gt;
    &lt;role rolename="admin"/&gt;
    &lt;user username="admin" password="admin" roles="admin,manager-gui,manager-script"/&gt;
  
  &lt;/tomcat-users&gt;
  </code></pre>
  
  <p>So i m not sure whether the problem is cos of the config in <code>tomcat-users.xml</code> file or something else.</p>
  
  <p>Note: this is web.xml of myApp</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&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;myApp&lt;/display-name&gt;
  
      &lt;!-- Default page to serve --&gt;
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;myApp.html&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  
  
      &lt;listener&gt;
          &lt;listener-class&gt;myApp.server.guice.GuiceServletConfig&lt;/listener-class&gt;
      &lt;/listener&gt;
  
      &lt;filter&gt;
          &lt;filter-name&gt;guiceFilter&lt;/filter-name&gt;
          &lt;filter-class&gt;com.google.inject.servlet.GuiceFilter&lt;/filter-class&gt;
      &lt;/filter&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;guiceFilter&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
      &lt;context-param&gt;
      &lt;!-- max size of the upload request --&gt;
      &lt;param-name&gt;maxSize&lt;/param-name&gt;
      &lt;param-value&gt;5145728&lt;/param-value&gt;
    &lt;/context-param&gt;
    &lt;context-param&gt;
      &lt;param-name&gt;slowUploads&lt;/param-name&gt;
      &lt;param-value&gt;200&lt;/param-value&gt;
    &lt;/context-param&gt;
  
    &lt;servlet&gt;
      &lt;servlet-name&gt;uploadServlet&lt;/servlet-name&gt;
      &lt;!-- This is the default servlet, it puts files in session --&gt;
      &lt;servlet-class&gt;myApp.server.SampleUploadServlet&lt;/servlet-class&gt;
    &lt;/servlet&gt;
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;uploadServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.gupld&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  
  
    &lt;servlet&gt;
      &lt;servlet-name&gt;SimpleCaptcha&lt;/servlet-name&gt;
      &lt;servlet-class&gt;
          myApp.server.ExtendedCaptchaServlet
      &lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;width&lt;/param-name&gt;
          &lt;param-value&gt;200&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;height&lt;/param-name&gt;
          &lt;param-value&gt;50&lt;/param-value&gt;
      &lt;/init-param&gt;
    &lt;/servlet&gt;
  
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;SimpleCaptcha&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/SimpleCaptcha.jpg&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>Catalina.2014-05-09.log:</p>
  
  <pre>
      09-May-2014 04:52:27.290 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: 
   org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/myApp]]
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:702)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:697)
      at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1134)
      at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1780)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "javax.servlet.http.HttpServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V" the class loader (instance of java/net/URLClassLoader) of the current class, gwtupload/server/UploadServlet, and the class loader (instance of org/apache/catalina/loader/WebappClassLoader) for interface javax/servlet/Servlet have different Class objects for the type let/ServletResponse;)V used in the signature
      at java.lang.Class.getDeclaredFields0(Native Method)
      at java.lang.Class.privateGetDeclaredFields(Class.java:2397)
      at java.lang.Class.getDeclaredFields(Class.java:1806)
      at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)
      at org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:261)
      at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:140)
      at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:66)
      at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:332)
      at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:771)
      at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:303)
      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:5058)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      ... 10 more
  
  09-May-2014 04:52:27.305 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Error deploying web application directory C:\tomcat8\webapps\myApp
   java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/myApp]]
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:729)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:702)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:697)
      at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1134)
      at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1780)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)
  
  09-May-2014 04:52:27.321 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\tomcat8\webapps\examples
  09-May-2014 04:52:28.102 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\tomcat8\webapps\host-manager
  09-May-2014 04:52:28.133 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\tomcat8\webapps\manager
  09-May-2014 04:52:28.274 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\tomcat8\webapps\ROOT
  09-May-2014 04:52:28.336 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
  09-May-2014 04:52:28.336 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
  09-May-2014 04:52:28.336 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 13386 ms
  </pre>