title: Tomcat can't launch my web application from the war file
body: <p>My application is originally developed with the Play! framework version 2.3. </p>
  
  <p>I am trying to run my web application from a war file with tomcat 7.</p>
  
  <p>When launching, tomcat logs this:</p>
  
  <pre><code>Sep 13, 2015 12:28:54 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
  WARNING: Problem with directory [/usr/share/tomcat7/common], exists: [false], isDirectory: [false], canRead: [false]
  Sep 13, 2015 12:28:55 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
  WARNING: Problem with directory [/usr/share/tomcat7/server/classes], exists: [false], isDirectory: [false], canRead: [false]
  Sep 13, 2015 12:28:55 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
  WARNING: Problem with directory [/usr/share/tomcat7/server], exists: [false], isDirectory: [false], canRead: [false]
  Sep 13, 2015 12:28:55 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
  WARNING: Problem with directory [/usr/share/tomcat7/shared/classes], exists: [false], isDirectory: [false], canRead: [false]
  Sep 13, 2015 12:28:55 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
  WARNING: Problem with directory [/usr/share/tomcat7/shared], exists: [false], isDirectory: [false], canRead: [false]
  Sep 13, 2015 12:29:10 PM org.apache.coyote.AbstractProtocol init
  INFO: Initializing ProtocolHandler ["http-bio-8080"]
  Sep 13, 2015 12:29:10 PM org.apache.catalina.startup.Catalina load
  INFO: Initialization processed in 13170 ms
  Sep 13, 2015 12:29:10 PM org.apache.catalina.core.StandardService startInternal
  INFO: Starting service Catalina
  Sep 13, 2015 12:29:10 PM org.apache.catalina.core.StandardEngine startInternal
  INFO: Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu)
  Sep 13, 2015 12:29:11 PM org.apache.catalina.startup.HostConfig deployDescriptor
  INFO: Deploying configuration descriptor /etc/tomcat7/Catalina/localhost/manager.xml
  Sep 13, 2015 12:29:12 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
  INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [177] milliseconds.
  Sep 13, 2015 12:29:13 PM org.apache.catalina.startup.HostConfig deployDescriptor
  INFO: Deploying configuration descriptor /etc/tomcat7/Catalina/localhost/host-manager.xml
  Sep 13, 2015 12:29:13 PM org.apache.catalina.startup.HostConfig deployWAR
  INFO: Deploying web application archive /var/lib/tomcat7/webapps/confscheduler.war
  Sep 13, 2015 12:29:27 PM org.apache.catalina.core.StandardContext startInternal
  SEVERE: Error listenerStart
  Sep 13, 2015 12:29:27 PM org.apache.catalina.core.StandardContext startInternal
  SEVERE: Context [/confscheduler] startup failed due to previous errors
  Sep 13, 2015 12:29:27 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
  SEVERE: The web application [/confscheduler] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
  Sep 13, 2015 12:29:27 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
  SEVERE: The web application [/confscheduler] registered the JDBC driver [play.utils.ProxyDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
  Sep 13, 2015 12:29:27 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
  SEVERE: The web application [/confscheduler] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.
  Sep 13, 2015 12:29:27 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
  SEVERE: The web application [/confscheduler] appears to have started a thread named [BoneCP-keep-alive-scheduler] but has failed to stop it. This is very likely to create a memory leak.
  Sep 13, 2015 12:29:27 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
  SEVERE: The web application [/confscheduler] appears to have started a thread named [BoneCP-max-alive-scheduler] but has failed to stop it. This is very likely to create a memory leak.
  Sep 13, 2015 12:29:27 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
  SEVERE: The web application [/confscheduler] appears to have started a thread named [BoneCP-pool-watch-thread] but has failed to stop it. This is very likely to create a memory leak.
  Sep 13, 2015 12:29:27 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
  SEVERE: The web application [/confscheduler] appears to have started a thread named [net.sf.ehcache.CacheManager@518fdf9] but has failed to stop it. This is very likely to create a memory leak.
  Sep 13, 2015 12:29:27 PM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
  Sep 13, 2015 12:29:28 PM org.apache.coyote.AbstractProtocol start
  INFO: Starting ProtocolHandler ["http-bio-8080"]
  Sep 13, 2015 12:29:28 PM org.apache.catalina.startup.Catalina start
  INFO: Server startup in 17500 ms
  Sep 13, 2015 12:29:58 PM org.apache.coyote.AbstractProtocol pause
  INFO: Pausing ProtocolHandler ["http-bio-8080"]
  Sep 13, 2015 12:29:58 PM org.apache.catalina.core.StandardService stopInternal
  INFO: Stopping service Catalina
  Sep 13, 2015 12:29:58 PM org.apache.coyote.AbstractProtocol stop
  INFO: Stopping ProtocolHandler ["http-bio-8080"]
  Sep 13, 2015 12:29:58 PM org.apache.coyote.AbstractProtocol destroy
  INFO: Destroying ProtocolHandler ["http-bio-8080"]
  Sep 13, 2015 12:41:56 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
  WARNING: Problem with directory [/usr/share/tomcat7/common/classes], exists: [false], isDirectory: [false], canRead: [false]
  Sep 13, 2015 12:41:56 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
  WARNING: Problem with directory [/usr/share/tomcat7/common], exists: [false], isDirectory: [false], canRead: [false]
  Sep 13, 2015 12:41:56 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
  WARNING: Problem with directory [/usr/share/tomcat7/server/classes], exists: [false], isDirectory: [false], canRead: [false]
  Sep 13, 2015 12:41:56 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
  WARNING: Problem with directory [/usr/share/tomcat7/server], exists: [false], isDirectory: [false], canRead: [false]
  Sep 13, 2015 12:41:56 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
  WARNING: Problem with directory [/usr/share/tomcat7/shared/classes], exists: [false], isDirectory: [false], canRead: [false]
  Sep 13, 2015 12:41:56 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
  WARNING: Problem with directory [/usr/share/tomcat7/shared], exists: [false], isDirectory: [false], canRead: [false]
  Sep 13, 2015 12:41:56 PM org.apache.coyote.AbstractProtocol init
  INFO: Initializing ProtocolHandler ["http-bio-8080"]
  Sep 13, 2015 12:41:56 PM org.apache.catalina.startup.Catalina load
  INFO: Initialization processed in 459 ms
  Sep 13, 2015 12:41:56 PM org.apache.catalina.core.StandardService startInternal
  INFO: Starting service Catalina
  Sep 13, 2015 12:41:56 PM org.apache.catalina.core.StandardEngine startInternal
  INFO: Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu)
  Sep 13, 2015 12:41:56 PM org.apache.catalina.startup.HostConfig deployDescriptor
  INFO: Deploying configuration descriptor /etc/tomcat7/Catalina/localhost/manager.xml
  Sep 13, 2015 12:41:57 PM org.apache.catalina.startup.HostConfig deployDescriptor
  INFO: Deploying configuration descriptor /etc/tomcat7/Catalina/localhost/host-manager.xml
  Sep 13, 2015 12:41:57 PM org.apache.catalina.startup.HostConfig deployWAR
  INFO: Deploying web application archive /var/lib/tomcat7/webapps/confscheduler.war
  Sep 13, 2015 12:42:02 PM org.apache.catalina.core.StandardContext startInternal
  SEVERE: Error listenerStart
  Sep 13, 2015 12:42:02 PM org.apache.catalina.core.StandardContext startInternal
  SEVERE: Context [/confscheduler] startup failed due to previous errors
  Sep 13, 2015 12:42:02 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
  SEVERE: The web application [/confscheduler] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
  Sep 13, 2015 12:42:02 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
  SEVERE: The web application [/confscheduler] registered the JDBC driver [play.utils.ProxyDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
  Sep 13, 2015 12:42:02 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
  SEVERE: The web application [/confscheduler] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.
  Sep 13, 2015 12:42:02 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
  SEVERE: The web application [/confscheduler] appears to have started a thread named [BoneCP-keep-alive-scheduler] but has failed to stop it. This is very likely to create a memory leak.
  Sep 13, 2015 12:42:02 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
  SEVERE: The web application [/confscheduler] appears to have started a thread named [BoneCP-max-alive-scheduler] but has failed to stop it. This is very likely to create a memory leak.
  Sep 13, 2015 12:42:02 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
  SEVERE: The web application [/confscheduler] appears to have started a thread named [BoneCP-pool-watch-thread] but has failed to stop it. This is very likely to create a memory leak.
  Sep 13, 2015 12:42:02 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
  SEVERE: The web application [/confscheduler] appears to have started a thread named [net.sf.ehcache.CacheManager@7009c732] but has failed to stop it. This is very likely to create a memory leak.
  Sep 13, 2015 12:42:02 PM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
  Sep 13, 2015 12:42:02 PM org.apache.coyote.AbstractProtocol start
  INFO: Starting ProtocolHandler ["http-bio-8080"]
  Sep 13, 2015 12:42:02 PM org.apache.catalina.startup.Catalina start
  INFO: Server startup in 5882 ms
  Sep 13, 2015 12:43:02 PM org.apache.catalina.loader.WebappClassLoader loadClass
  INFO: Illegal access: this web application instance has been stopped already.  Could not load com.mysql.jdbc.DatabaseMetaData$9.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
  java.lang.IllegalStateException
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1610)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569)
      at com.mysql.jdbc.DatabaseMetaData.getTables(DatabaseMetaData.java:5260)
      at com.jolbox.bonecp.BoneCP.isConnectionHandleAlive(BoneCP.java:713)
      at com.jolbox.bonecp.ConnectionTesterThread.run(ConnectionTesterThread.java:103)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
      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)
  
  Sep 13, 2015 12:43:02 PM org.apache.catalina.loader.WebappClassLoader loadClass
  INFO: Illegal access: this web application instance has been stopped already.  Could not load ch.qos.logback.classic.spi.ThrowableProxy.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
  java.lang.IllegalStateException
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1610)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569)
      at ch.qos.logback.classic.spi.LoggingEvent.&lt;init&gt;(LoggingEvent.java:121)
      at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:440)
      at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:396)
      at ch.qos.logback.classic.Logger.error(Logger.java:559)
      at com.jolbox.bonecp.ConnectionTesterThread.run(ConnectionTesterThread.java:146)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
      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)
  </code></pre>
  
  <p>We can already see many warnings but I don't understand their meaning, some directory doesn't exists but I've installed my tomcat with a traditional <code>apt-get install</code> that would have normally install everything I need.</p>
  
  <p>The problem is that I can't make it work, I tried to stop tomcat then move the war file to the webapps directory and start tomcat again: this doesn't launched my app..</p>
  
  <p>Then I connected to the tomcat web application manager, my app (confscheduler) is visible and not running:
  <a href="https://i.stack.imgur.com/yf2DQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yf2DQ.png" alt="Image of the manager where we can see that my webapp (confscheduler) is present"></a></p>
  
  <p>I tried the start button on the right of my webapp name but after a bit of time the manager showed up this message:
  FAIL - Application at context path /confscheduler could not be started</p>
  
  <pre><code>FAIL - Application at context path /confscheduler could not be started
  </code></pre>
  
  <p>Here is the part of my catalina.log where we can see my attempt:</p>
  
  <pre><code>Sep 12, 2015 9:48:49 PM org.apache.catalina.core.StandardContext startInternal
  SEVERE: Error listenerStart
  Sep 12, 2015 9:48:49 PM org.apache.catalina.core.StandardContext startInternal
  SEVERE: Context [/confscheduler] startup failed due to previous errors
  Sep 12, 2015 9:48:49 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
  SEVERE: The web application [/confscheduler] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
  Sep 12, 2015 9:48:49 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
  SEVERE: The web application [/confscheduler] registered the JDBC driver [play.utils.ProxyDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
  Sep 12, 2015 9:48:49 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
  SEVERE: The web application [/confscheduler] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.
  Sep 12, 2015 9:48:49 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
  SEVERE: The web application [/confscheduler] appears to have started a thread named [BoneCP-keep-alive-scheduler] but has failed to stop it. This is very likely to create a memory leak.
  Sep 12, 2015 9:48:49 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
  SEVERE: The web application [/confscheduler] appears to have started a thread named [BoneCP-max-alive-scheduler] but has failed to stop it. This is very likely to create a memory leak.
  Sep 12, 2015 9:48:49 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
  SEVERE: The web application [/confscheduler] appears to have started a thread named [BoneCP-pool-watch-thread] but has failed to stop it. This is very likely to create a memory leak.
  Sep 12, 2015 9:48:49 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
  SEVERE: The web application [/confscheduler] appears to have started a thread named [net.sf.ehcache.CacheManager@6a0b76a6] but has failed to stop it. This is very likely to create a memory leak.
  </code></pre>
  
  <p>The .war file has been created from my Play! Framework 2.3 Application by using the <a href="https://github.com/play2war/play2-war-plugin" rel="nofollow noreferrer">play2war</a> plugin, I really followed the tutorial of the project but I don't know if the problem comes from the war file or the tomcat servlet.</p>
  
  <p>If you have any idea of what I've done wrong or what could help me getting over this problem please tell me.</p>
  
  <p>Thanks for help</p>