title: Spring REST API controller is not called
body: <p>i have following code </p>
  
  <p>Controller </p>
  
  <pre><code>@RestController 
  @RequestMapping("/") 
  public class RequestHandler {
      @RequestMapping(value = "/demo", method = RequestMethod.POST)
       @ResponseBody 
      public Object showDemo() {
  
          return "Post method";
      }
  
  
      @RequestMapping(value = { "/getdemo" }, method = RequestMethod.GET)
        @ResponseBody 
      public  Object showgetDemo() {
    System.out.println("hello");
          return "get Method";
      }
  }
  </code></pre>
  
  <p>My pom xml</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/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;Website2015&lt;/groupId&gt;
    &lt;artifactId&gt;Website2015&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&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.2.1.RELEASE&lt;/version&gt;
          &lt;relativePath /&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-test&lt;/artifactId&gt; 
  &lt;scope&gt;test&lt;/scope&gt; 
  &lt;/dependency&gt; 
  &lt;/dependencies&gt;  
    &lt;build&gt;
      &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
          &lt;version&gt;3.3&lt;/version&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;plugin&gt;
          &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.6&lt;/version&gt;
          &lt;configuration&gt;
            &lt;warSourceDirectory&gt;WebContent&lt;/warSourceDirectory&gt;
            &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
  
    &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>and to launch Spring boot application :</p>
  
  <pre><code>@Configuration
  @EnableWebMvc
  @SpringBootApplication
  public class AppLauncher  {
  
      public static void main(String[] args) {
          SpringApplication.run(AppLauncher.class, args);
  
      }
  
      private static Class&lt;AppLauncher&gt; applicationClass = AppLauncher.class;
  
  }
  </code></pre>
  
  <p>Server logs</p>
  
  <pre><code>    2015-10-21 16:07:59.314  INFO 12892 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http)
  2015-10-21 16:07:59.470  INFO 12892 --- [           main] o.apache.catalina.core.StandardService   : Starting service Tomcat
  2015-10-21 16:07:59.471  INFO 12892 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.0.15
  2015-10-21 16:07:59.561  INFO 12892 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
  2015-10-21 16:07:59.561  INFO 12892 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1158 ms
  2015-10-21 16:07:59.716  INFO 12892 --- [ost-startStop-1] o.s.b.c.e.ServletRegistrationBean        : Mapping servlet: 'dispatcherServlet' to [/]
  2015-10-21 16:07:59.719  INFO 12892 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean  : Mapping filter: 'characterEncodingFilter' to: [/*]
  2015-10-21 16:07:59.921  INFO 12892 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.http.ResponseEntity&lt;java.util.Map&lt;java.lang.String, java.lang.Object&gt;&gt; org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
  2015-10-21 16:07:59.921  INFO 12892 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],methods=[],params=[],headers=[],consumes=[],produces=[text/html],custom=[]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest)
  2015-10-21 16:08:00.119  INFO 12892 --- [           main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@25af5db5: startup date [Wed Oct 21 16:07:58 CEST 2015]; root of context hierarchy
  2015-10-21 16:08:00.275  INFO 12892 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
  2015-10-21 16:08:00.322  INFO 12892 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
  2015-10-21 16:08:00.323  INFO 12892 --- [           main] c.xx.yy.misc.AppLauncher   : Started AppLauncher in 2.16 seconds (JVM running for 2.496)
  </code></pre>
  
  <p>I am using POSTMAN Rest client .All i am getting is </p>
  
  <blockquote>
    <p>{
        "timestamp": 1445436550585,
        "status": 404,
        "error": "Not Found",
        "message": "No message available",
        "path": "/get" }</p>
  </blockquote>
  
  <p>i cant find mapping in server logs as well .
  My best guess after spending a lot of time is false project structure.</p>
  
  <p>I created new Dynamic web project and converted it into Maven , ofcourse i tried it with simple java project and then converted it into maven .</p>
  
  <p>Please give me some pointers and if more info is required please let me know thanks. </p>