title: No errors, but mapping does not work Spring boot + tomcat 8.0
body: <p>I wanted to create a tiny app running on spring boot. When I package it into a jar file the app runs smoothly on my local machine. 
  I decided to deploy it on AWS elastic beanstalk, so I did the changes needed for creation of .war file (<a href="https://docs.spring.io/spring-boot/docs/current/reference/html/howto-traditional-deployment.html" rel="nofollow">https://docs.spring.io/spring-boot/docs/current/reference/html/howto-traditional-deployment.html</a>)</p>
  
  <p>I wanted to try it running on my local TOMCAT. So i placed the war file in the webapps directory, and run the Tomcat 8.0\bin\Tomcat8.exe</p>
  
  <p>The logs in the console look ok, there is even an info that the <code>/hello</code> route got mapped. The server runs, but when I enter the localhost:8080/hello nothing is returned. No error, just an empty page. </p>
  
  <pre><code>...........
  
  rtInternal Starting Servlet Engine: Apache Tomcat/8.0.32
  13-Feb-2016 23:57:32.965 INFO [localhost-startStop-1] org.apache.catalina.startu
  p.HostConfig.deployWAR Deploying web application archive C:\Program Files\Apache
   Software Foundation\Tomcat 8.0\webapps\superheroes-0.0.1-SNAPSHOT.war
  13-Feb-2016 23:57:43.058 INFO [localhost-startStop-1] org.apache.jasper.servlet.
  TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs.
   Enable debug logging for this logger for a complete list of JARs that were scan
  ned but no TLDs were found in them. Skipping unneeded JARs during scanning can i
  mprove startup time and JSP compilation time.
  
    .   ____          _            __ _ _
   /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
  ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
   \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
    '  |____| .__|_| |_|_| |_\__, | / / / /
   =========|_|==============|___/=/_/_/_/
   :: Spring Boot ::        (v1.3.2.RELEASE)
  
  2016-02-13 23:57:46.723  INFO 7804 --- [ost-startStop-1] com.ga1.SuperHeroesAppl
  ication           : Starting SuperHeroesApplication v0.0.1-SNAPSHOT on Kamil-PC
  with PID 7804 (started by Kamil in C:\Program Files\Apache Software Foundation\T
  omcat 8.0)
  2016-02-13 23:57:46.734  INFO 7804 --- [ost-startStop-1] com.ga1.SuperHeroesAppl
  ication           : No active profile set, falling back to default profiles: def
  ault
  2016-02-13 23:57:47.076  INFO 7804 --- [ost-startStop-1] ationConfigEmbeddedWebA
  pplicationContext : Refreshing org.springframework.boot.context.embedded.Annotat
  ionConfigEmbeddedWebApplicationContext@1935808: startup date [Sat Feb 13 23:57:4
  7 ICT 2016]; root of context hierarchy
  2016-02-13 23:57:49.030  INFO 7804 --- [ost-startStop-1] o.s.b.f.s.DefaultListab
  leBeanFactory     : Overriding bean definition for bean 'beanNameViewResolver' w
  ith a different definition: replacing [Root bean: class [null]; scope=; abstract
  =false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=tru
  e; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.Err
  orMvcAutoConfiguration$WhitelabelErrorViewConfiguration; factoryMethodName=beanN
  ameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in c
  lass path resource [org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfi
  guration$WhitelabelErrorViewConfiguration.class]] with [Root bean: class [null];
   scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; auto
  wireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.auto
  configure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter; factoryMet
  hodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred);
   defined in class path resource [org/springframework/boot/autoconfigure/web/WebM
  vcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]]
  2016-02-13 23:57:49.775  INFO 7804 --- [ost-startStop-1] o.s.web.context.Context
  Loader            : Root WebApplicationContext: initialization completed in 2701
   ms
  2016-02-13 23:57:50.957  INFO 7804 --- [ost-startStop-1] b.a.w.TomcatWebSocketCo
  ntainerCustomizer : NonEmbeddedServletContainerFactory detected. Websockets supp
  ort should be native so this normally is not a problem.
  2016-02-13 23:57:51.674  INFO 7804 --- [ost-startStop-1] o.s.b.c.e.ServletRegist
  rationBean        : Mapping servlet: 'dispatcherServlet' to [/]
  2016-02-13 23:57:51.676  INFO 7804 --- [ost-startStop-1] o.s.b.c.embedded.Filter
  RegistrationBean  : Mapping filter: 'errorPageFilter' to: [/*]
  2016-02-13 23:57:51.677  INFO 7804 --- [ost-startStop-1] o.s.b.c.embedded.Filter
  RegistrationBean  : Mapping filter: 'characterEncodingFilter' to: [/*]
  2016-02-13 23:57:51.678  INFO 7804 --- [ost-startStop-1] o.s.b.c.embedded.Filter
  RegistrationBean  : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
  2016-02-13 23:57:51.680  INFO 7804 --- [ost-startStop-1] o.s.b.c.embedded.Filter
  RegistrationBean  : Mapping filter: 'httpPutFormContentFilter' to: [/*]
  2016-02-13 23:57:51.681  INFO 7804 --- [ost-startStop-1] o.s.b.c.embedded.Filter
  RegistrationBean  : Mapping filter: 'requestContextFilter' to: [/*]
  2016-02-13 23:57:52.361  INFO 7804 --- [ost-startStop-1] s.w.s.m.m.a.RequestMapp
  ingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.cont
  ext.embedded.AnnotationConfigEmbeddedWebApplicationContext@1935808: startup date
   [Sat Feb 13 23:57:47 ICT 2016]; root of context hierarchy
  2016-02-13 23:57:52.635  INFO 7804 --- [ost-startStop-1] s.w.s.m.m.a.RequestMapp
  ingHandlerMapping : Mapped "{[/superHero],methods=[POST]}" onto public org.sprin
  gframework.http.ResponseEntity&lt;java.lang.Void&gt; com.ga1.superheroes.MainControlle
  r.createSuperHero(com.ga1.superheroes.repository.RepositorySuperHero)
  2016-02-13 23:57:52.639  INFO 7804 --- [ost-startStop-1] s.w.s.m.m.a.RequestMapp
  ingHandlerMapping : Mapped "{[/superHero],methods=[GET]}" onto public org.spring
  framework.http.ResponseEntity&lt;com.ga1.superheroes.repository.RepositorySuperHero
  &gt; com.ga1.superheroes.MainController.getSuperHero(java.lang.String)
  2016-02-13 23:57:52.640  INFO 7804 --- [ost-startStop-1] s.w.s.m.m.a.RequestMapp
  ingHandlerMapping : Mapped "{[/superHeroes],methods=[GET]}" onto public org.spri
  ngframework.http.ResponseEntity&lt;java.util.List&lt;java.lang.String&gt;&gt; com.ga1.superh
  eroes.MainController.getSuperHeroes()
  2016-02-13 23:57:52.641  INFO 7804 --- [ost-startStop-1] s.w.s.m.m.a.RequestMapp
  ingHandlerMapping : Mapped "{[/hello],methods=[GET]}" onto public org.springfram
  ework.http.ResponseEntity&lt;java.lang.String&gt; com.ga1.superheroes.MainController.h
  ello()
  2016-02-13 23:57:52.654  INFO 7804 --- [ost-startStop-1] s.w.s.m.m.a.RequestMapp
  ingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.Res
  ponseEntity&lt;java.util.Map&lt;java.lang.String, java.lang.Object&gt;&gt; org.springframewo
  rk.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServ
  letRequest)
  2016-02-13 23:57:52.655  INFO 7804 --- [ost-startStop-1] s.w.s.m.m.a.RequestMapp
  ingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.spr
  ingframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web
  .BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.serv
  let.http.HttpServletResponse)
  2016-02-13 23:57:52.733  INFO 7804 --- [ost-startStop-1] o.s.w.s.handler.SimpleU
  rlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class or
  g.springframework.web.servlet.resource.ResourceHttpRequestHandler]
  2016-02-13 23:57:52.733  INFO 7804 --- [ost-startStop-1] o.s.w.s.handler.SimpleU
  rlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.spring
  framework.web.servlet.resource.ResourceHttpRequestHandler]
  2016-02-13 23:57:52.843  INFO 7804 --- [ost-startStop-1] o.s.w.s.handler.SimpleU
  rlHandlerMapping  : Mapped URL path [/**/favicon.ico] onto handler of type [clas
  s org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
  2016-02-13 23:57:54.877  INFO 7804 --- [ost-startStop-1] org.mongodb.driver.clus
  ter               : Cluster created with settings {hosts=[localhost:27017], mode
  =SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWait
  QueueSize=500}
  2016-02-13 23:57:55.325  INFO 7804 --- [localhost:27017] org.mongodb.driver.conn
  ection            : Opened connection [connectionId{localValue:1, serverValue:16
  }] to localhost:27017
  2016-02-13 23:57:55.328  INFO 7804 --- [localhost:27017] org.mongodb.driver.clus
  ter               : Monitor thread successfully connected to server with descrip
  tion ServerDescription{address=localhost:27017, type=STANDALONE, state=CONNECTED
  , ok=true, version=ServerVersion{versionList=[3, 0, 5]}, minWireVersion=0, maxWi
  reVersion=3, maxDocumentSize=16777216, roundTripTimeNanos=876166}
  2016-02-13 23:57:55.549  INFO 7804 --- [ost-startStop-1] o.s.j.e.a.AnnotationMBe
  anExporter        : Registering beans for JMX exposure on startup
  2016-02-13 23:57:55.590  INFO 7804 --- [ost-startStop-1] com.ga1.SuperHeroesAppl
  ication           : Started SuperHeroesApplication in 11.432 seconds (JVM runnin
  g for 24.405)
  13-Feb-2016 23:57:55.716 INFO [localhost-startStop-1] org.apache.catalina.startu
  p.HostConfig.deployWAR Deployment of web application archive C:\Program Files\Ap
  ache Software Foundation\Tomcat 8.0\webapps\superheroes-0.0.1-SNAPSHOT.war has f
  inished in 22,750 ms
  13-Feb-2016 23:57:55.721 INFO [main] org.apache.coyote.AbstractProtocol.start St
  arting ProtocolHandler ["http-nio-8080"]
  13-Feb-2016 23:57:55.737 INFO [main] org.apache.coyote.AbstractProtocol.start St
  arting ProtocolHandler ["ajp-nio-8009"]
  13-Feb-2016 23:57:55.742 INFO [main] org.apache.catalina.startup.Catalina.start
  Server startup in 22911 ms
  </code></pre>
  
  <p>Below are my: <em>pom</em>, <em>controller</em> and <em>main</em> files</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &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/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.ga1&lt;/groupId&gt;
      &lt;artifactId&gt;superheroes&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
  
      &lt;name&gt;superheroes&lt;/name&gt;
      &lt;description&gt;really super&lt;/description&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.2.RELEASE&lt;/version&gt;
          &lt;relativePath /&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
  
      &lt;properties&gt;
  &lt;!--        &lt;tomcat.version&gt;8.0.8&lt;/tomcat.version&gt; --&gt;
  &lt;!--        &lt;start-class&gt;com.ga1.SuperHeroesApplication&lt;/start-class&gt; --&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;java.version&gt;1.8&lt;/java.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.google.guava&lt;/groupId&gt;
              &lt;artifactId&gt;guava&lt;/artifactId&gt;
              &lt;version&gt;19.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
              &lt;artifactId&gt;commons-lang3&lt;/artifactId&gt;
              &lt;version&gt;3.3.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.mongodb&lt;/groupId&gt;
              &lt;artifactId&gt;mongo-java-driver&lt;/artifactId&gt;
              &lt;version&gt;3.2.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.mockito&lt;/groupId&gt;
              &lt;artifactId&gt;mockito-all&lt;/artifactId&gt;
              &lt;version&gt;1.9.5&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.google.code.gson&lt;/groupId&gt;
              &lt;artifactId&gt;gson&lt;/artifactId&gt;
              &lt;version&gt;2.5&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&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&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;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.mongodb&lt;/groupId&gt;
              &lt;artifactId&gt;mongo-java-driver&lt;/artifactId&gt;
              &lt;version&gt;3.2.1&lt;/version&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;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  
  &lt;/project&gt;
  </code></pre>
  
  <p>The controller:</p>
  
  <pre><code>package com.ga1.superheroes;
  
  import org.springframework.http.HttpStatus;
  import org.springframework.http.ResponseEntity;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  import org.springframework.web.bind.annotation.RestController;
  
  @RestController
  public class MainController {
  
      @RequestMapping(value = "/hello", method = RequestMethod.GET)
      public ResponseEntity&lt;String&gt; hello() {
          return new ResponseEntity&lt;&gt;("Hello World", HttpStatus.OK);
      }
  
  }
  </code></pre>
  
  <p>and the Main:</p>
  
  <pre><code>package com.ga1;
  
  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 SuperHeroesApplication extends SpringBootServletInitializer {
  
      public static void main(String[] args) {
          SpringApplication.run(SuperHeroesApplication.class, args);
      }
  
      @Override
      protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
          return application.sources(SuperHeroesApplication.class);
      }
  
  }
  </code></pre>