Spring REST always return 404 Not Found
<p>Ive setup a simple REST API using Spring 4 with Spring security</p>

<p><strong>web.xml</strong></p>

<pre><code>&lt;context-param&gt;
    &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
    &lt;param-value&gt;/WEB-INF/mysabisabi-servlet.xml,
     classpath*:META-INF/spring/applicationContext.xml,
      classpath*:META-INF/spring/mysabisabi-security.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;servlet&gt;
    &lt;servlet-name&gt;mysabisabi-rest&lt;/servlet-name&gt;
    &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
&lt;/servlet&gt;
&lt;servlet-mapping&gt;
    &lt;servlet-name&gt;mysabisabi-rest&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;
</code></pre>

<p><strong>AccountController.java</strong></p>

<pre><code>@RestController
@RequestMapping(value="/api")
public class AccountController {


    @RequestMapping(value="/update", method=RequestMethod.POST)
public ResponseEntity&lt;GenericResponse&gt; updateRegistrationToken(@RequestBody RegistrationToken token){
    GenericResponse response = new GenericResponse();
    //some code here

    return new ResponseEntity&lt;GenericResponse&gt;(response, HttpStatus.ACCEPTED);
}

}
</code></pre>

<p><strong>mysabisabi-servlet.xml</strong></p>

<pre><code>&lt;bean id="jacksonObjectMapper" class="com.mysabisabi.mapper.JsonCustomMapper" /&gt;

&lt;bean id="jackson2HttpMessageConverter"
    class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"&gt;
    &lt;property name="objectMapper" ref="jacksonObjectMapper" /&gt;
&lt;/bean&gt;

&lt;mvc:annotation-driven&gt;
    &lt;mvc:message-converters register-defaults="true"&gt;
        &lt;ref bean="jackson2HttpMessageConverter" /&gt;
    &lt;/mvc:message-converters&gt;
&lt;/mvc:annotation-driven&gt;
</code></pre>

<p><strong>mysabisabi-security.xml</strong></p>

<pre><code> &lt;http pattern="/oauth/token" create-session="stateless" authentication-manager-ref="clientAuthenticationManager"
    xmlns="http://www.springframework.org/schema/security"&gt;
&lt;intercept-url pattern="/oauth/token" access="isFullyAuthenticated()"/&gt;
&lt;csrf disabled="true"/&gt;
&lt;anonymous enabled="false"/&gt;
&lt;http-basic entry-point-ref="clientAuthenticationEntryPoint"/&gt;
&lt;!-- include this only if you need to authenticate clients via request parameters --&gt;
&lt;custom-filter ref="clientCredentialsTokenEndpointFilter" after="BASIC_AUTH_FILTER"/&gt;
&lt;access-denied-handler ref="oauthAccessDeniedHandler"/&gt;
 &lt;/http&gt;

  &lt;http pattern="/api/*" create-session="never" entry-point-ref="oauthAuthenticationEntryPoint"
    access-decision-manager-ref="accessDecisionManager" xmlns="http://www.springframework.org/schema/security"&gt;
&lt;anonymous enabled="false"/&gt;
&lt;csrf disabled="true"/&gt;
&lt;intercept-url pattern="/api/*"  access="hasRole('ROLE_USER')"/&gt;
&lt;custom-filter ref="resourceServerFilter" before="PRE_AUTH_FILTER"/&gt;
&lt;access-denied-handler ref="oauthAccessDeniedHandler"/&gt;
</code></pre>

<p></p>

<p>applicationContext.xml</p>

<pre><code>&lt;mvc:annotation-driven /&gt;

&lt;context:annotation-config /&gt;

&lt;context:component-scan base-package="com.mysabisabi" /&gt;

&lt;context:property-placeholder location="classpath:mysabisabi.properties" /&gt;

&lt;tx:annotation-driven transaction-manager="transactionManager" /&gt;


//dataSource configuration
</code></pre>

<p><strong>LOG File</strong></p>

<pre><code>2016-07-16 16:24:45 INFO  RequestMappingHandlerMapping:537 - Mapped "{[/api/update],methods=[POST]}" onto public org.springframework.http.ResponseEntity&lt;com.mysabisabi.dto.response.GenericResponse&gt; com.mysabisabi.controller.AccountController.updateRegistrationToken(com.mysabisabi.dto.request.RegistrationToken)
</code></pre>

<p>When I tried to access <code>http://localhost:8080/mysabisabi/api/update</code> I got  <code>HTTPStatus 404 Not Found - The requested resource is not available</code></p>

<p>I've tried both <code>/</code> and <code>/*</code> as url-pattern but still the same.</p>

<p>Can someone point out what did I miss?</p>

<p>Thanks.</p>