title: Spring, MVC and REST in two servlets
body: <p><strong>Long story short:</strong>
  I have MVC servlet that handles requests correctly, but REST servlet seems to never handle any request, at all. Like it was not there, or requests are somehow not matched.</p>
  
  <p><strong>In more details:</strong></p>
  
  <p>My spring version is 4.2.1.</p>
  
  <p>I have an application with Spring MVC, which already works. Problem is a second servlet, that I want to add, so it would handle REST requests.</p>
  
  <p>This was the <code>web.xml</code> <strong>before</strong> I tried to add REST servlet into it (so everything worked here so far):</p>
  
  <pre><code>&lt;web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 
       http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
       version="3.1"&gt;
  
      &lt;display-name&gt;My app&lt;/display-name&gt;
  
      &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;/WEB-INF/core-context.xml /WEB-INF/spring-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-mapping&gt;
          &lt;servlet-name&gt;AccServlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.do&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.do&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;RestServlet&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;filter&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt;
      &lt;/filter&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
      &lt;session-config&gt;
          &lt;session-timeout&gt;10&lt;/session-timeout&gt;
      &lt;/session-config&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>In few words - all requests to <code>*.do</code> will be handled by MVC servlet, all requests in general will pass through Spring Security.</p>
  
  <p>I have a simple MVC controller to handle that:</p>
  
  <pre><code>@Controller
  public class JspController {
  
      @Autowired
      private UserService userService;
  
      @RequestMapping(value = "/index.do", method = RequestMethod.GET)
      public String provideIndexModel(ModelMap model) {
          User user = userService.getLoggedUser();
          model.addAttribute("user", user.getUsername());
          if (user.getBusiness() != null) {
              model.addAttribute("business", user.getBusiness().getCompanyName());
          }
          return "index";
      }
  
      @RequestMapping(value = "/login.do", method = {RequestMethod.GET})
      public String provideLoginModel(ModelMap model) {
          return "login";
      }
  
      public UserService getUserService() {
          return userService;
      }
  
      public void setUserService(UserService userService) {
          this.userService = userService;
      }
  }
  </code></pre>
  
  <p>The controller is in package scanned by proper scan declaration in servlet's context xml file.</p>
  
  <p>Now, what I did to enable REST was to add following servlet to <code>web.xml</code>:</p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;AccServlet&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;RestServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.rest&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>Then I created another servlet context file <code>RestServlet-servlet.xml</code>, where I put <code>&lt;context:component-scan base-package="my.app.rest"/&gt;</code> - that's the package, where I then put a RestController, like this:</p>
  
  <pre><code>@RestController
  public class RestService {
  
      public RestService() {
          System.out.println("yes!");
      }
  
      @RequestMapping(value = "/user.rest", method = RequestMethod.GET)
      public String getUser() {
          return "abc";
      }
  }
  </code></pre>
  
  <p>The rest controller indeed is created (I debugged the constructor), so spring does see it, but when I try to call it from the Postman (Chrome extension), I get 404 response. My request is for URL: <code>localhost:8080/acc/user.rest</code> (where <code>acc</code> is my app name).</p>
  
  <p>Why my calls matching <code>*.rest</code> do not get redirected to proper controller? (I tried to stop there in debug - it's never called).</p>
  
  <p><strong>EDIT 1:</strong></p>
  
  <p>This is my current full web.xml:</p>
  
  <pre><code>&lt;web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 
           http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
           version="3.1"&gt;
  
      &lt;display-name&gt;My app&lt;/display-name&gt;
  
      &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;/WEB-INF/core-context.xml /WEB-INF/spring-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-mapping&gt;
          &lt;servlet-name&gt;AccServlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.do&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.do&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;AccServlet&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;RestServlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/rest/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;RestServlet&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;filter&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt;
      &lt;/filter&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
      &lt;session-config&gt;
          &lt;session-timeout&gt;10&lt;/session-timeout&gt;
      &lt;/session-config&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>This is my core-context.xml:</p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
      xmlns:tx="http://www.springframework.org/schema/tx"
      xsi:schemaLocation="
          http://www.springframework.org/schema/beans
          http://www.springframework.org/schema/beans/spring-beans.xsd   
          http://www.springframework.org/schema/tx
          http://www.springframework.org/schema/tx/spring-tx.xsd
          http://www.springframework.org/schema/context     
          http://www.springframework.org/schema/context/spring-context.xsd"&gt;
  
      &lt;context:component-scan base-package="my.app"&gt;
          &lt;context:exclude-filter expression="org.springframework.stereotype.Controller"
              type="annotation" /&gt;
      &lt;/context:component-scan&gt;
  
      &lt;bean id="accDataSource" class="org.apache.commons.dbcp.BasicDataSource"
          destroy-method="close"&gt;
          &lt;property name="driverClassName" value="org.postgresql.Driver" /&gt;
          &lt;property name="url" value="jdbc:postgresql://localhost/acc" /&gt;
          &lt;property name="username" value="acc" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="accSessionFactory"
          class="org.springframework.orm.hibernate5.LocalSessionFactoryBean"&gt;
          &lt;property name="dataSource" ref="accDataSource" /&gt;
          &lt;property name="packagesToScan"&gt;
              &lt;list&gt;
                  &lt;value&gt;my.app.entities&lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
          &lt;property name="hibernateProperties"&gt;
              &lt;value&gt;
                  hibernate.dialect=org.hibernate.dialect.PostgreSQL92Dialect
              &lt;/value&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="txManager"
          class="org.springframework.orm.hibernate5.HibernateTransactionManager"&gt;
          &lt;property name="sessionFactory" ref="accSessionFactory" /&gt;
      &lt;/bean&gt;
  
      &lt;tx:annotation-driven transaction-manager="txManager" /&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>This is AccServlet-servlet.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: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="my.app.web"/&gt;
  
      &lt;bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
        &lt;property name="prefix" value="/WEB-INF/jsp/" /&gt;
        &lt;property name="suffix" value=".jsp" /&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>This my RestServlet-servlet.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: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="my.app.rest"/&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>I have <code>@Controller</code> for MVC in <code>my.app.web</code> and I have <code>@RestController</code> in <code>my.app.rest</code>.</p>
  
  <p>Logs from tomcat:</p>
  
  <pre><code>20-Oct-2015 14:00:16.096 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.0.23
  20-Oct-2015 14:00:16.097 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          May 19 2015 14:58:38 UTC
  20-Oct-2015 14:00:16.097 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.0.23.0
  20-Oct-2015 14:00:16.097 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
  20-Oct-2015 14:00:16.097 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            3.14.33
  20-Oct-2015 14:00:16.097 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
  20-Oct-2015 14:00:16.097 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/lib64/java/jre
  20-Oct-2015 14:00:16.097 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_45-b14
  20-Oct-2015 14:00:16.097 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
  20-Oct-2015 14:00:16.098 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
  20-Oct-2015 14:00:16.174 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
  20-Oct-2015 14:00:16.183 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
  20-Oct-2015 14:00:16.184 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
  20-Oct-2015 14:00:16.185 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
  20-Oct-2015 14:00:16.185 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 297 ms
  20-Oct-2015 14:00:16.200 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
  20-Oct-2015 14:00:16.200 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.23
  20-Oct-2015 14:00:16.213 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /home/googie/projects/tomcat/webapps/acc.war
  20-Oct-2015 14:00:16.951 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 scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
  20-Oct-2015 14:00:16.968 INFO [localhost-startStop-1] org.springframework.web.context.ContextLoader.initWebApplicationContext Root WebApplicationContext: initialization started
  20-Oct-2015 14:00:17.012 INFO [localhost-startStop-1] org.springframework.web.context.support.XmlWebApplicationContext.prepareRefresh Refreshing Root WebApplicationContext: startup date [Tue Oct 20 14:00:17 CEST 2015]; root of context hierarchy
  20-Oct-2015 14:00:17.031 INFO [localhost-startStop-1] org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions Loading XML bean definitions from ServletContext resource [/WEB-INF/core-context.xml]
  20-Oct-2015 14:00:17.149 INFO [localhost-startStop-1] org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions Loading XML bean definitions from ServletContext resource [/WEB-INF/spring-security.xml]
  20-Oct-2015 14:00:17.176 INFO [localhost-startStop-1] org.springframework.security.core.SpringSecurityCoreVersion.performVersionChecks You are running with Spring Security Core 4.0.2.RELEASE
  20-Oct-2015 14:00:17.178 INFO [localhost-startStop-1] org.springframework.security.config.SecurityNamespaceHandler.&lt;init&gt; Spring Security 'config' module version is 4.0.2.RELEASE
  20-Oct-2015 14:00:17.197 INFO [localhost-startStop-1] org.springframework.security.config.http.FilterInvocationSecurityMetadataSourceParser.parseInterceptUrlsForFilterInvocationRequestMap Creating access control expression attribute 'hasRole('ROLE_USER')' for /**
  20-Oct-2015 14:00:17.231 INFO [localhost-startStop-1] org.springframework.security.config.http.HttpSecurityBeanDefinitionParser.checkFilterChainOrder Checking sorted filter chain: [Root bean: class [org.springframework.security.web.context.SecurityContextPersistenceFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 200, Root bean: class [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 400, Root bean: class [org.springframework.security.web.header.HeaderWriterFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 500, Root bean: class [org.springframework.security.web.authentication.logout.LogoutFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 700, &lt;org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0&gt;, order = 1100, Root bean: class [org.springframework.security.web.authentication.www.BasicAuthenticationFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1500, Root bean: class [org.springframework.security.web.savedrequest.RequestCacheAwareFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1600, Root bean: class [org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1700, Root bean: class [org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1900, Root bean: class [org.springframework.security.web.authentication.AnonymousAuthenticationFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 2000, Root bean: class [org.springframework.security.web.session.SessionManagementFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 2100, Root bean: class [org.springframework.security.web.access.ExceptionTranslationFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 2200, &lt;org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0&gt;, order = 2300]
  20-Oct-2015 14:00:17.489 INFO [localhost-startStop-1] org.hibernate.Version.logVersion HHH000412: Hibernate Core {5.0.2.Final}
  20-Oct-2015 14:00:17.490 INFO [localhost-startStop-1] org.hibernate.cfg.Environment.&lt;clinit&gt; HHH000206: hibernate.properties not found
  20-Oct-2015 14:00:17.491 INFO [localhost-startStop-1] org.hibernate.cfg.Environment.buildBytecodeProvider HHH000021: Bytecode provider name : javassist
  20-Oct-2015 14:00:17.521 INFO [localhost-startStop-1] org.hibernate.annotations.common.reflection.java.JavaReflectionManager.&lt;clinit&gt; HCANN000001: Hibernate Commons Annotations {5.0.0.Final}
  20-Oct-2015 14:00:17.613 INFO [localhost-startStop-1] org.hibernate.dialect.Dialect.&lt;init&gt; HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL92Dialect
  20-Oct-2015 14:00:17.704 INFO [localhost-startStop-1] org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl.useContextualLobCreation HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
  20-Oct-2015 14:00:17.705 INFO [localhost-startStop-1] org.hibernate.type.BasicTypeRegistry.register HHH000270: Type registration [java.util.UUID] overrides previous : org.hibernate.type.UUIDBinaryType@43d414e2
  20-Oct-2015 14:00:18.117 INFO [localhost-startStop-1] org.springframework.orm.hibernate5.HibernateTransactionManager.afterPropertiesSet Using DataSource [org.apache.commons.dbcp.BasicDataSource@4c992a74] of Hibernate SessionFactory for HibernateTransactionManager
  20-Oct-2015 14:00:18.130 INFO [localhost-startStop-1] org.springframework.security.web.DefaultSecurityFilterChain.&lt;init&gt; Creating filter chain: Ant [pattern='/lib/**'], []
  20-Oct-2015 14:00:18.132 INFO [localhost-startStop-1] org.springframework.security.web.DefaultSecurityFilterChain.&lt;init&gt; Creating filter chain: Ant [pattern='/plugins/**'], []
  20-Oct-2015 14:00:18.133 INFO [localhost-startStop-1] org.springframework.security.web.DefaultSecurityFilterChain.&lt;init&gt; Creating filter chain: Ant [pattern='/dist/**'], []
  20-Oct-2015 14:00:18.134 INFO [localhost-startStop-1] org.springframework.security.web.DefaultSecurityFilterChain.&lt;init&gt; Creating filter chain: Ant [pattern='/bootstrap/**'], []
  20-Oct-2015 14:00:18.135 INFO [localhost-startStop-1] org.springframework.security.web.DefaultSecurityFilterChain.&lt;init&gt; Creating filter chain: Ant [pattern='/css/**'], []
  20-Oct-2015 14:00:18.136 INFO [localhost-startStop-1] org.springframework.security.web.DefaultSecurityFilterChain.&lt;init&gt; Creating filter chain: Ant [pattern='/fonts/**'], []
  20-Oct-2015 14:00:18.137 INFO [localhost-startStop-1] org.springframework.security.web.DefaultSecurityFilterChain.&lt;init&gt; Creating filter chain: Ant [pattern='/login*'], []
  20-Oct-2015 14:00:18.270 INFO [localhost-startStop-1] org.springframework.security.web.DefaultSecurityFilterChain.&lt;init&gt; Creating filter chain: org.springframework.security.web.util.matcher.AnyRequestMatcher@1, [org.springframework.security.web.context.SecurityContextPersistenceFilter@4a5281b8, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@42066dde, org.springframework.security.web.header.HeaderWriterFilter@7fda7a84, org.springframework.security.web.authentication.logout.LogoutFilter@67125593, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@39134788, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@488ab5e9, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@6428f826, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@116387fd, org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter@32efbd5e, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@2f576317, org.springframework.security.web.session.SessionManagementFilter@c9d5713, org.springframework.security.web.access.ExceptionTranslationFilter@14c7512, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@4e063d28]
  20-Oct-2015 14:00:18.277 INFO [localhost-startStop-1] org.springframework.security.config.http.DefaultFilterChainValidator.checkLoginPageIsntProtected Checking whether login URL '/login.do' is accessible with your configuration
  20-Oct-2015 14:00:18.297 INFO [localhost-startStop-1] org.springframework.web.context.ContextLoader.initWebApplicationContext Root WebApplicationContext: initialization completed in 1329 ms
  20-Oct-2015 14:00:18.320 INFO [localhost-startStop-1] org.springframework.web.servlet.DispatcherServlet.initServletBean FrameworkServlet 'AccServlet': initialization started
  20-Oct-2015 14:00:18.322 INFO [localhost-startStop-1] org.springframework.web.context.support.XmlWebApplicationContext.prepareRefresh Refreshing WebApplicationContext for namespace 'AccServlet-servlet': startup date [Tue Oct 20 14:00:18 CEST 2015]; parent: Root WebApplicationContext
  20-Oct-2015 14:00:18.322 INFO [localhost-startStop-1] org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions Loading XML bean definitions from ServletContext resource [/WEB-INF/AccServlet-servlet.xml]
  20-Oct-2015 14:00:18.369 INFO [localhost-startStop-1] org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping.registerHandler Mapped URL path [/index.do] onto handler 'jspController'
  20-Oct-2015 14:00:18.369 INFO [localhost-startStop-1] org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping.registerHandler Mapped URL path [/login.do] onto handler 'jspController'
  20-Oct-2015 14:00:18.517 INFO [localhost-startStop-1] org.springframework.web.servlet.DispatcherServlet.initServletBean FrameworkServlet 'AccServlet': initialization completed in 197 ms
  20-Oct-2015 14:00:18.517 INFO [localhost-startStop-1] org.springframework.web.servlet.DispatcherServlet.initServletBean FrameworkServlet 'RestServlet': initialization started
  20-Oct-2015 14:00:18.518 INFO [localhost-startStop-1] org.springframework.web.context.support.XmlWebApplicationContext.prepareRefresh Refreshing WebApplicationContext for namespace 'RestServlet-servlet': startup date [Tue Oct 20 14:00:18 CEST 2015]; parent: Root WebApplicationContext
  20-Oct-2015 14:00:18.518 INFO [localhost-startStop-1] org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions Loading XML bean definitions from ServletContext resource [/WEB-INF/RestServlet-servlet.xml]
  20-Oct-2015 14:00:18.539 INFO [localhost-startStop-1] org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping.registerHandler Mapped URL path [/rest/user] onto handler 'restService'
  20-Oct-2015 14:00:18.539 INFO [localhost-startStop-1] org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping.registerHandler Mapped URL path [/rest/user.*] onto handler 'restService'
  20-Oct-2015 14:00:18.539 INFO [localhost-startStop-1] org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping.registerHandler Mapped URL path [/rest/user/] onto handler 'restService'
  20-Oct-2015 14:00:18.545 INFO [localhost-startStop-1] org.springframework.web.servlet.DispatcherServlet.initServletBean FrameworkServlet 'RestServlet': initialization completed in 28 ms
  20-Oct-2015 14:00:18.552 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /home/googie/projects/tomcat/webapps/acc.war has finished in 2,338 ms
  20-Oct-2015 14:00:18.552 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /home/googie/projects/tomcat/webapps/manager
  20-Oct-2015 14:00:18.569 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /home/googie/projects/tomcat/webapps/manager has finished in 17 ms
  20-Oct-2015 14:00:18.571 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
  20-Oct-2015 14:00:18.578 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
  20-Oct-2015 14:00:18.579 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 2394 ms
  20-Oct-2015 14:00:37.639 INFO [http-nio-8080-exec-8] org.hibernate.hql.internal.QueryTranslatorFactoryInitiator.initiateService HHH000397: Using ASTQueryTranslatorFactory
  20-Oct-2015 14:00:50.965 WARNING [http-nio-8080-exec-6] org.springframework.web.servlet.PageNotFound.noHandlerFound No mapping found for HTTP request with URI [/acc/rest/user] in DispatcherServlet with name 'RestServlet'
  </code></pre>
  
  <p>Note, that the last line in log comes from my GET request try to the rest service.</p>