title: Exception in thread "main" java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationContextInitializer
body: <p>I am facing the following error:</p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.IllegalArgumentException: Cannot
    instantiate interface
    org.springframework.context.ApplicationContextInitializer :
    org.springframework.boot.autoconfigure.SharedMetadataReaderFactoryContextInitializer
      at
    org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:414)
      at
    org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:394)
      at
    org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:385)
      at
    org.springframework.boot.SpringApplication.initialize(SpringApplication.java:261)
      at
    org.springframework.boot.SpringApplication.(SpringApplication.java:237)
      at
    org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)
      at
    org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)</p>
  </blockquote>
  
  <p>My main method is</p>
  
  <pre><code>package proj1;
  
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.boot.builder.SpringApplicationBuilder;
  import org.springframework.boot.context.web.SpringBootServletInitializer;
  
  @SpringBootApplication
  public class WebApplication extends SpringBootServletInitializer {
      @Override
      protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
          return application.sources(WebApplication.class);
      }
  
      public static void main(String[] args) throws Exception {
          SpringApplication.run(WebApplication.class, args);
      }
  }
  </code></pre>
  
  <p>My pom.xml is</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.webapp&lt;/groupId&gt;
    &lt;artifactId&gt;proj1&lt;/artifactId&gt;
    &lt;packaging&gt;war&lt;/packaging&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.3.5.RELEASE&lt;/version&gt;
      &lt;/parent&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;name&gt;proj1 Maven Webapp&lt;/name&gt;
    &lt;url&gt;http://maven.apache.org&lt;/url&gt;
    &lt;dependencies&gt;
     &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
              &lt;version&gt;4.0.0.RELEASE&lt;/version&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;dependency&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-autoconfigure&lt;/artifactId&gt;
      &lt;version&gt;1.4.0.RELEASE&lt;/version&gt;
  &lt;/dependency&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-tomcat&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
  &lt;!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot --&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
      &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
      &lt;version&gt;3.1.0&lt;/version&gt;
      &lt;scope&gt;provided&lt;/scope&gt;
  &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.tomcat.embed&lt;/groupId&gt;
              &lt;artifactId&gt;tomcat-embed-jasper&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
    &lt;/dependencies&gt;
    &lt;build&gt;
      &lt;finalName&gt;proj1&lt;/finalName&gt;
    &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>