title: cannot access org.springframework.web.WebApplicationInitializer
body: <p>I am currently working through the example on scheduling tasks using Spring 4, Java 1.8, and Gradle (<a href="https://spring.io/guides/gs/scheduling-tasks/" rel="noreferrer">https://spring.io/guides/gs/scheduling-tasks/</a>).</p>
  
  <p>However, when running this example, I receive the following error:</p>
  
  <blockquote>
    <p>Error:(11, 8) java: cannot access org.springframework.web.WebApplicationInitializer
      class file for org.springframework.web.WebApplicationInitializer not found</p>
  </blockquote>
  
  <p>The source code to my Application.java is as follows:</p>
  
  <pre><code>package hello;
  
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.boot.builder.SpringApplicationBuilder;
  import org.springframework.boot.web.support.SpringBootServletInitializer;
  import org.springframework.scheduling.annotation.EnableScheduling;
  
  @SpringBootApplication
  @EnableScheduling
  public class Application extends SpringBootServletInitializer {
  
      @Override
      protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
          return application.sources(Application.class);
      }
  
      public static void main(String[] args) throws Exception {
          SpringApplication.run(Application.class);
      }
  }
  </code></pre>
  
  <p>My gradle file:</p>
  
  <pre><code>buildscript {
      repositories {
          mavenCentral()
      }
      dependencies {
          classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.2.RELEASE")
      }
  }
  
  apply plugin: 'java'
  apply plugin: 'eclipse'
  apply plugin: 'idea'
  apply plugin: 'org.springframework.boot'
  apply plugin: 'war'
  
  jar {
      baseName = 'gs-scheduling-tasks'
      version =  '0.1.0'
  }
  
  repositories {
      mavenCentral()
  }
  
  sourceCompatibility = 1.8
  targetCompatibility = 1.8
  
  dependencies {
      compile("org.springframework.boot:spring-boot-starter")
      testCompile("org.springframework.boot:spring-boot-starter-test")
      providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
  }
  </code></pre>
  
  <p>Why is org.springframework.web.WebApplicationInitializer causing this error when it is not even mentioned in the guide?  </p>
  
  <p>Thanks.</p>