title: SpringBoot Catalina LifeCycle Exception
body: <p>I have a SpringBoot Application for a simple web service which connects to Postgres DB. But when I run the application it does not start and throws following exception: </p>
  
  <pre><code>    2016-09-08 11:26:15 INFO  c.t.i.c.Main:659 - No active profile set, falling back to default profiles: default
  2016-09-08 11:26:20 ERROR o.a.c.c.ContainerBase:181 - A child container failed during start
  java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
      at java.util.concurrent.FutureTask.report(FutureTask.java:122)
      at java.util.concurrent.FutureTask.get(FutureTask.java:192)
      at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:911)
      at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:890)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1403)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1393)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:158)
      ... 6 common frames omitted
  Caused by: org.apache.catalina.LifecycleException: Failed to start component [Pipeline[StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]]
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:158)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5088)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
      ... 6 common frames omitted
  Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.authenticator.NonLoginAuthenticator[]]
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:158)
      at org.apache.catalina.core.StandardPipeline.startInternal(StandardPipeline.java:170)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
      ... 8 common frames omitted
  Caused by: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String;
      at org.apache.catalina.authenticator.AuthenticatorBase.startInternal(AuthenticatorBase.java:1085)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
      ... 10 common frames omitted
  2016-09-08 11:26:20 ERROR o.a.c.c.ContainerBase:181 - A child container failed during start
  java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]]
      at java.util.concurrent.FutureTask.report(FutureTask.java:122)
      at java.util.concurrent.FutureTask.get(FutureTask.java:192)
      at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:911)
      at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
      at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
      at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:791)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
      at org.apache.catalina.startup.Tomcat.start(Tomcat.java:356)
      at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:97)
      at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.&lt;init&gt;(TomcatEmbeddedServletContainer.java:83)
      at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:530)
      at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:176)
      at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:164)
      at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:535)
      at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
      at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)
      at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:369)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:313)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1185)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1174)
      at com.demo.item.classification.Main.main(Main.java:12)
  Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]]
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:158)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1403)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1393)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: org.apache.catalina.LifecycleException: A child container failed during start
      at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
      at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:890)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
      ... 6 common frames omitted
  2016-09-08 11:26:20 ERROR o.s.b.SpringApplication:838 - Application startup failed
  org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat
      at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:137)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:535)
      at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
      at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)
      at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:369)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:313)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1185)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1174)
      at com.demo.item.classification.Main.main(Main.java:12)
  Caused by: org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat
      at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:116)
      at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.&lt;init&gt;(TomcatEmbeddedServletContainer.java:83)
      at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:530)
      at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:176)
      at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:164)
      at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134)
      ... 8 common frames omitted
  Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardServer[-1]]
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:158)
      at org.apache.catalina.startup.Tomcat.start(Tomcat.java:356)
      at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:97)
      ... 13 common frames omitted
  Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Tomcat]]
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:158)
      at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:791)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
      ... 15 common frames omitted
  Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat]]
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:158)
      at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
      ... 17 common frames omitted
  Caused by: org.apache.catalina.LifecycleException: A child container failed during start
      at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
      at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
      ... 19 common frames omitted
  </code></pre>
  
  <p>My Main Class:</p>
  
  <pre><code>@SpringBootApplication
  @EnableAutoConfiguration
  public class Main {
  
      public static void main(String[] args) {
          SpringApplication.run(Main.class);
      }
  
  }
  </code></pre>
  
  <p>Build.gradle</p>
  
  <pre><code>dependencies {
       classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.0.RELEASE")
    }    
  dependencies {
        compile("org.springframework.boot:spring-boot-starter-web")
        compile("org.springframework.boot:spring-boot-starter-actuator")
        testCompile("org.springframework.boot:spring-boot-starter-test")
        compile 'com.github.alaisi.pgasync:postgres-async-driver:0.9'
        compile "org.postgresql:postgresql:9.4.1208"
        testCompile "org.mockito:mockito-core:1.+"
        testCompile "junit:junit:4.11"
        runtime "org.slf4j:slf4j-simple:1.7.10"
      }
  </code></pre>
  
  <p>The troubleshoots that I already tried:</p>
  
  <ol>
  <li>Looked for multiple jar/ version issues</li>
  <li>Tomcat &amp; Java compatibility issue</li>
  <li>Cleaned/Restarted/Reimported the project</li>
  <li>All build.gradle permutation and combinations</li>
  <li>Checked whether any other application is running on 8080, also changed the port to 9090, still no help.</li>
  </ol>
  
  <p>Please tell me any other reason and fix for the problem.</p>