title: SpringMVC URI mapping no more working
body: <p>I'm sorry this is a kind of duplicate question of this other one already asked by me: <a href="https://stackoverflow.com/questions/18645877/spring-mvc-rest-no-mapping-found-for-http-request-with-uri-ecommerce-api-rest">Spring MVC Rest: No mapping found for HTTP request with URI [/ecommerce-api/rest/checkout] in DispatcherServlet</a></p>
  
  <p>But I'm getting mad, since the problem after while appears again. When everything seems to be working suddenly it stops :-(</p>
  
  <p>I'm trying to build an API with SpringMVC, I'm developing using STS 3.3.0 and testing with the rest shell 1.2.1.</p>
  
  <p>The command I'm issuing is:</p>
  
  <blockquote>
    <p>get ecommerce-api/rest/checkout</p>
  </blockquote>
  
  <p>and the error I got is:</p>
  
  <blockquote>
    <p>2013-09-10 11:56:49,614 DEBUG [tomcat-http--9]
    servlet.DispatcherServlet (DispatcherServlet.java:823) -
    DispatcherServlet with name 'api-dispatcher' processing GET request
    for [/ecommerce-api/rest/checkout] 2013-09-10 11:56:49,615 DEBUG
    [tomcat-http--9] handler.AbstractHandlerMethodMapping
    (AbstractHandlerMethodMapping.java:220) - Looking up handler method
    for path /checkout 2013-09-10 11:56:49,615 DEBUG [tomcat-http--9]
    handler.AbstractHandlerMethodMapping
    (AbstractHandlerMethodMapping.java:230) - Did not find handler method
    for [/checkout] 2013-09-10 11:56:49,615 WARN  [tomcat-http--9]
    servlet.DispatcherServlet (DispatcherServlet.java:1108) - No mapping
    found for HTTP request with URI [/ecommerce-api/rest/checkout] in
    DispatcherServlet with name 'api-dispatcher' 2013-09-10 11:56:49,615
    DEBUG [tomcat-http--9] servlet.FrameworkServlet
    (FrameworkServlet.java:966) - Successfully completed request</p>
  </blockquote>
  
  <p><strong>Until yesterday everything was working absolutely fine</strong>, this morning I tried to add some more functionalities to my really basic controller and I got the above error. </p>
  
  <p>What I tried without success:</p>
  
  <p>1) reverting to last working version from git repositories</p>
  
  <p>2) deploying the war package in a clean Tomcat install (trying to have avoid any possible issue related to Eclipse)</p>
  
  <p>3) unpublishing the package from the vFabric within STS - cleaning its working dir - cleaning the project - deploying it again</p>
  
  <p>I copy there my *.xml and java files, even if they seems to be ok since they worked since a couple of hours ago.</p>
  
  <p>Any idea or suggestion will be really appreciated.</p>
  
  <p>A frustrated developer (aka Alexio).</p>
  
  <p><strong>web.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&gt;
  
  &lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;
          /WEB-INF/application-context.xml
      &lt;/param-value&gt;
  &lt;/context-param&gt;
  
  &lt;listener&gt;
      &lt;listener-class&gt;
          org.springframework.web.context.ContextLoaderListener
      &lt;/listener-class&gt;
  &lt;/listener&gt;
  &lt;listener&gt;
      &lt;listener-class&gt;
          org.springframework.web.context.request.RequestContextListener
      &lt;/listener-class&gt;
  &lt;/listener&gt;
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;api-dispatcher&lt;/servlet-name&gt;
      &lt;servlet-class&gt;
          org.springframework.web.servlet.DispatcherServlet
      &lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;/WEB-INF/api-dispatcher-servlet.xml&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;debug&lt;/param-name&gt;
          &lt;param-value&gt;6&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;api-dispatcher&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/rest/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  
  &lt;listener&gt;
      &lt;listener-class&gt;
          org.springframework.web.context.request.RequestContextListener
      &lt;/listener-class&gt;
  &lt;/listener&gt;
  
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p><strong>api-dispatcher.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;beans:beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
      xmlns:context="http://www.springframework.org/schema/context"
      xmlns:util="http://www.springframework.org/schema/util"
      xmlns:mvc="http://www.springframework.org/schema/mvc"
      xsi:schemaLocation="http://www.springframework.org/schema/mvc 
      http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd 
      http://www.springframework.org/schema/beans 
      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
      http://www.springframework.org/schema/util 
      http://www.springframework.org/schema/util/spring-util-3.0.xsd 
      http://www.springframework.org/schema/context 
      http://www.springframework.org/schema/context/spring-context-3.0.xsd"&gt;
  
      &lt;context:component-scan base-package="com.fashionis.api.ecommerce.controller" /&gt;
      &lt;context:annotation-config /&gt;
      &lt;mvc:annotation-driven /&gt;
  
      &lt;import resource="classpath:/ecommerce-services-beans.xml"/&gt;
  
  &lt;/beans:beans&gt;
  </code></pre>
  
  <p><strong>checkoutcontroller.java</strong></p>
  
  <pre><code>@Controller
  @RequestMapping("/checkout")
  public class CheckoutController {
  
      private static final Logger logger = LoggerFactory.getLogger(CheckoutController.class);
  
          @RequestMapping(method = RequestMethod.GET)
      public @ResponseBody
      Checkout getRandomCheckout() {
  
          logger.debug("Before instantiating checkoutManager");
          @SuppressWarnings("resource")
          ConfigurableApplicationContext ctx = new ClassPathXmlApplicationContext("ecommerce-services-beans.xml");
          CheckoutManager checkoutManager = ctx.getBean("checkoutManager", CheckoutManager.class);
  
          logger.debug("Before asking for checkout");
  
          Checkout checkout = checkoutManager
                  .findById("514f2a8e20f7a78a1400001f");
  
          logger.debug("Checkout obtained. Con ID:" + checkout.getId());
  
          return checkout;
      }
  }
  </code></pre>