title: Getting 404 on simple Spring 4 REST service
body: <p>I am trying to access a RESTful web service I have written:</p>
  
  <pre><code>http://localhost:8080/dukegen/ws/family/1
  </code></pre>
  
  <p>but getting a 404 using the address bar in the browser and do not know why.  I am trying to return JSON.  I have put Jackson 2 on my classpath:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
      &lt;version&gt;2.3.1&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Here is the server output:</p>
  
  <pre><code>Jan 14, 2014 8:29:55 PM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
  INFO: Mapped URL path [/ws/family/{familyId}] onto handler 'familyResource'
  Jan 14, 2014 8:29:55 PM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
  INFO: Mapped URL path [/ws/family/{familyId}.*] onto handler 'familyResource'
  Jan 14, 2014 8:29:55 PM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
  INFO: Mapped URL path [/ws/family/{familyId}/] onto handler 'familyResource'
  Jan 14, 2014 8:29:55 PM org.springframework.web.servlet.FrameworkServlet initServletBean
  INFO: FrameworkServlet 'dispatcher': initialization completed in 360 ms
  Jan 14, 2014 8:29:55 PM org.springframework.web.servlet.DispatcherServlet noHandlerFound
  WARNING: No mapping found for HTTP request with URI [/dukegen/ws/family/1] in DispatcherServlet with name 'dispatcher'
  </code></pre>
  
  <p>Here is my Controller:</p>
  
  <pre><code>@Controller
  @RequestMapping("ws")
  public class FamilyResource {
  
      @RequestMapping(value="family/{familyId}", method = RequestMethod.GET, produces="application/json")
      public @ResponseBody Family getFamily(@PathVariable long familyId) {
              .... builds Family object ....
               return family;
           }
  
  }
  </code></pre>
  
  <p>Here is my dispatcher set up in web.xml:</p>
  
  <pre><code> &lt;servlet&gt;
          &lt;servlet-name&gt;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;classpath:/mvcContext.xml&lt;/param-value&gt;
          &lt;/init-param&gt;
    &lt;/servlet&gt;
  
    &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/ws/*&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>My mvcContext.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:p="http://www.springframework.org/schema/p"
      xmlns:context="http://www.springframework.org/schema/context"
      xsi:schemaLocation="
          http://www.springframework.org/schema/beans
          http://www.springframework.org/schema/beans/spring-beans.xsd
          http://www.springframework.org/schema/context
          http://www.springframework.org/schema/context/spring-context.xsd"&gt;
  
      &lt;context:component-scan base-package="ws.hamacher.dukegen.resource"/&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>Any help would appreciated.</p>