title: Spring Tomcat 404 resource not found
body: <p>I'm trying to deploy an simple REST api with Spring inside a Tomcat installation, but all I'm getting are 404 resource not found when the war is deployed. It's running perfectly on localhost, but deploying is just not working. Tried every solution on stackoverflow, but almost all use configuration files instead of configuration annotations. This is my (important) code.</p>
  
  <p>slember.gradle</p>
  
  <pre><code> buildscript {
      ext {
          springBootVersion = '1.4.1.RELEASE'
      }
      repositories {
          mavenCentral()
      }
      dependencies {
          classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
      }
  }
  
  apply plugin: 'java'
  apply plugin: 'eclipse'
  apply plugin: 'spring-boot'
  apply plugin: 'idea'
  apply plugin: 'war'
  
  springBoot{
      executable = true
  }
  
  war {
      baseName = 'slember'
  }
  
  jar {
      baseName = 'slember'
  }
  sourceCompatibility = 1.7
  targetCompatibility = 1.7
  
  repositories {
      mavenCentral()
  }
  
  
  dependencies {
      compile('org.springframework.boot:spring-boot-starter-web')
      compile("org.springframework.boot:spring-boot-starter-data-jpa")
      compile 'org.hibernate:hibernate-core:5.0.9.Final'
      compile("com.h2database:h2")
      testCompile('org.springframework.boot:spring-boot-starter-test')
      compile 'javax.servlet:javax.servlet-api:3.1.0'
      compile 'org.javassist:javassist:3.15.0-GA'
      compile 'mysql:mysql-connector-java:5.1.31'
      compile 'commons-dbcp:commons-dbcp:1.4'
      compile('org.springframework.boot:spring-boot-starter-jdbc')
      compileOnly "org.projectlombok:lombok:1.16.10"
      providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
  
  
  }
  </code></pre>
  
  <p>SlemberApplication.java</p>
  
  <pre><code>@SpringBootApplication
  @EntityScan(basePackageClasses = {
          SlemberApplication.class
  })
  public class SlemberApplication {
  
      public static AnnotationConfigApplicationContext context;
  
      public static void main(String[] args) {
  
          SpringApplication.run(SlemberApplication.class, args);
          context = new AnnotationConfigApplicationContext();
          context.register(AppConfig.class);
          context.refresh();
      }
  }
  </code></pre>
  
  <p>META-INF/MANIFEST.MF</p>
  
  <pre><code>Manifest-Version: 1.0
  Main-Class: com.letscode.SlemberApplication
  </code></pre>