title: Spring boot project failing with NoSuchMethodError: javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String
body: <p>I have a simple Spring Boot project, I have shown the pom file below</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.abccompany&lt;/groupId&gt;
      &lt;artifactId&gt;simpletest&lt;/artifactId&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;jsoncomponenttest Maven Webapp&lt;/name&gt;
      &lt;url&gt;http://maven.apache.org&lt;/url&gt;
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;1.4.2.RELEASE&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.h2database&lt;/groupId&gt;
              &lt;artifactId&gt;h2&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-jdbc&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;3.8.1&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
          &lt;finalName&gt;simpletest&lt;/finalName&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>The project was working fine, but suddenly when I am running this Spring boot project in eclipse, I am getting below exception </p>
  
  <pre><code>ava.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) [na:1.8.0_91]
      at java.util.concurrent.FutureTask.get(FutureTask.java:192) [na:1.8.0_91]
      at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:911) ~[tomcat-embed-core-8.5.6.jar:8.5.6]
      at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:890) [tomcat-embed-core-8.5.6.jar:8.5.6]
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.6.jar:8.5.6]
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1403) [tomcat-embed-core-8.5.6.jar:8.5.6]
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1393) [tomcat-embed-core-8.5.6.jar:8.5.6]
      at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_91]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_91]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_91]
      at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91]
  Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) [tomcat-embed-core-8.5.6.jar:8.5.6]
      ... 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:167) [tomcat-embed-core-8.5.6.jar:8.5.6]
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5099) ~[tomcat-embed-core-8.5.6.jar:8.5.6]
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.6.jar:8.5.6]
      ... 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:167) [tomcat-embed-core-8.5.6.jar:8.5.6]
      at org.apache.catalina.core.StandardPipeline.startInternal(StandardPipeline.java:170) ~[tomcat-embed-core-8.5.6.jar:8.5.6]
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.6.jar:8.5.6]
      ... 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:1125) ~[tomcat-embed-core-8.5.6.jar:8.5.6]
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.6.jar:8.5.6]
      ... 10 common frames omitted
  </code></pre>
  
  <p>I have looked at this question <a href="https://stackoverflow.com/questions/34950164/getting-nosuchmethoderrorjavax-servlet-servletcontext-getvirtualservername">Getting NoSuchMethodError:javax.servlet.ServletContext.getVirtualServerName()</a></p>
  
  <p>And tried most of the options mentioned in solution, but nothing is working. Initially I thought it might be servlet-api issue, so switched to jetty, but then started getting another exception with <code>addServlet</code> , but now switched back to Tomcat.</p>