title: migration Spring project from tomcat 7 to tomcat 8
body: <p>I have a Spring project (MVC 4.2 + security 4.1 + hibernate 4.3). I try to migrate this project from tomcat7 to tomcat8 (everything is ok with tomcat7).
  Many errors that </p>
  
  <p>My new Eclipse project setting conf:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;faceted-project&gt;
    &lt;fixed facet="wst.jsdt.web"/&gt;
    &lt;installed facet="jst.jaxrs" version="1.1"/&gt;
    &lt;installed facet="wst.jsdt.web" version="1.0"/&gt;
    &lt;installed facet="java" version="1.7"/&gt;
    &lt;installed facet="jst.web" version="3.1"/&gt;
  &lt;/faceted-project&gt;
  </code></pre>
  
  <p>My errors</p>
  
  <pre><code>HTTP Status 500 - Servlet.init() for servlet dispatcher threw exception
  
  type Exception report
  
  message Servlet.init() for servlet dispatcher threw exception
  
  description The server encountered an internal error that prevented it from fulfilling this request.
  
  exception
  
  javax.servlet.ServletException: Servlet.init() for servlet dispatcher threw exception
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
      org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
      org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)
      org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
      org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
      org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
      java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      java.lang.Thread.run(Thread.java:745)
  root cause
  
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.annotation.internalAsyncAnnotationProcessor' defined in org.springframework.scheduling.annotation.ProxyAsyncConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor]: Factory method 'asyncAdvisor' threw exception; nested exception is java.lang.IllegalArgumentException: @EnableAsync annotation metadata was not injected
      org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
      org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
      org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
      org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
      org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:228)
      org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:687)
      org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:523)
      org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:666)
      org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:632)
      org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:680)
      org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:551)
      org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:492)
      org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
      javax.servlet.GenericServlet.init(GenericServlet.java:158)
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
      org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
      org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)
      org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
      org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
      org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
      java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      java.lang.Thread.run(Thread.java:745)
  root cause
  
  org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor]: Factory method 'asyncAdvisor' threw exception; nested exception is java.lang.IllegalArgumentException: @EnableAsync annotation metadata was not injected
      org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
      org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
      org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
      org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
      org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
      org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:228)
      org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:687)
      org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:523)
      org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:666)
      org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:632)
      org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:680)
      org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:551)
      org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:492)
      org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
      javax.servlet.GenericServlet.init(GenericServlet.java:158)
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
      org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
      org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)
      org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
      org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
      org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
      java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      java.lang.Thread.run(Thread.java:745)
  root cause
  
  java.lang.IllegalArgumentException: @EnableAsync annotation metadata was not injected
      org.springframework.util.Assert.notNull(Assert.java:115)
      org.springframework.scheduling.annotation.ProxyAsyncConfiguration.asyncAdvisor(ProxyAsyncConfiguration.java:46)
      org.springframework.scheduling.annotation.ProxyAsyncConfiguration$$EnhancerBySpringCGLIB$$694eb5c3.CGLIB$asyncAdvisor$0(&lt;generated&gt;)
      org.springframework.scheduling.annotation.ProxyAsyncConfiguration$$EnhancerBySpringCGLIB$$694eb5c3$$FastClassBySpringCGLIB$$13254074.invoke(&lt;generated&gt;)
      org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
      org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356)
      org.springframework.scheduling.annotation.ProxyAsyncConfiguration$$EnhancerBySpringCGLIB$$694eb5c3.asyncAdvisor(&lt;generated&gt;)
      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      java.lang.reflect.Method.invoke(Method.java:606)
      org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
      org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
      org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
      org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
      org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
      org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
      org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:228)
      org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:687)
      org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:523)
      org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:666)
      org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:632)
      org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:680)
      org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:551)
      org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:492)
      org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
      javax.servlet.GenericServlet.init(GenericServlet.java:158)
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
      org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
      org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)
      org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
      org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
      org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
      java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>dispatcher-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"
      xmlns:mvc="http://www.springframework.org/schema/mvc"
      xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd
          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
          http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd"&gt;
  
      &lt;!-- Scans the classpath of this application for @Components to deploy as 
          beans --&gt;
      &lt;context:component-scan base-package="." /&gt;
  
      &lt;!-- Configures the @Controller programming model --&gt;
      &lt;mvc:annotation-driven /&gt;
  
      &lt;!-- Forwards requests to the "/" resource to the "welcome" view --&gt;
  &lt;!--    &lt;mvc:view-controller path="/" view-name="home"  /&gt; --&gt;
  
      &lt;!-- Handles HTTP GET requests for /resources/** by efficiently serving 
          up static resources in the ${webappRoot}/resources/ directory --&gt;
      &lt;mvc:resources mapping="/resources/**" location="/resources/" /&gt;
  
      &lt;!-- Configures Handler Interceptors --&gt;
      &lt;mvc:interceptors&gt;
          &lt;!-- Changes the locale when a 'language' request parameter is sent; e.g. 
              /?language=de --&gt;
          &lt;bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor"&gt;
              &lt;property name="paramName" value="language" /&gt;
          &lt;/bean&gt;
          &lt;mvc:interceptor&gt;
              &lt;mvc:mapping path="/**Creation**" /&gt;
              &lt;mvc:mapping path="/**import**" /&gt;
              &lt;mvc:mapping path="/**Import**" /&gt;
              &lt;mvc:mapping path="/**update**" /&gt;
              &lt;mvc:mapping path="/**Update**" /&gt;
              &lt;mvc:mapping path="/**Deletion**" /&gt;
              &lt;mvc:mapping path="/**delete**" /&gt;
              &lt;mvc:mapping path="/**Copy**" /&gt;
              &lt;mvc:mapping path="/**Merge**" /&gt;
              &lt;mvc:mapping path="/**Publish**" /&gt;
              &lt;bean class="fr.lis.xper3.utils.Xper3UpdateInterceptor"&gt;&lt;/bean&gt;
          &lt;/mvc:interceptor&gt;
          &lt;mvc:interceptor&gt;
              &lt;mvc:mapping path="/**"/&gt;
              &lt;mvc:exclude-mapping path="/auth*"/&gt;
              &lt;mvc:exclude-mapping path="/security*"/&gt;
              &lt;mvc:exclude-mapping path="/kbEdition*"/&gt;
              &lt;mvc:exclude-mapping path="/resources/**"/&gt;
              &lt;mvc:exclude-mapping path="/"/&gt;
              &lt;mvc:exclude-mapping path="/user*"/&gt;
              &lt;mvc:exclude-mapping path="/admin*"/&gt;
              &lt;bean class="fr.lis.xper3.utils.Xper3DatasetInterceptor"&gt;&lt;/bean&gt;
          &lt;/mvc:interceptor&gt;
      &lt;/mvc:interceptors&gt;
  
      &lt;!-- Saves a locale change using the session or cookie --&gt;
      &lt;bean id="localeResolver"
          class="org.springframework.web.servlet.i18n.SessionLocaleResolver"&gt;
          &lt;property name="defaultLocale" value="en" /&gt;
      &lt;/bean&gt;
      &lt;!-- &lt;bean id="localeResolver" class="org.springframework.web.servlet.i18n.CookieLocaleResolver"&gt; 
          &lt;property name="defaultLocale" value="en" /&gt; &lt;/bean&gt; --&gt;
  
      &lt;!-- Resolves view names to protected .jsp resources within the /WEB-INF/views 
          directory --&gt;
      &lt;bean id="viewResolver"
          class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
          &lt;property name="prefix" value="/WEB-INF/views/" /&gt;
          &lt;property name="suffix" value=".jsp" /&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!-- &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" 
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_1.xsd" version="3.1"&gt;
   --&gt;
  &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;!-- Application context definition --&gt;
    &lt;listener&gt;
      &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
    &lt;/listener&gt;
    &lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;
              /WEB-INF/web-application-context.xml
              /WEB-INF/security-application-context.xml
          &lt;/param-value&gt;
    &lt;/context-param&gt;
    &lt;listener&gt;
      &lt;listener-class&gt;
              fr.lis.xper3.utils.Xper3ServerListener
           &lt;/listener-class&gt;
    &lt;/listener&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;!-- Reads request input using UTF-8 encoding --&gt;
    &lt;filter&gt;
      &lt;filter-name&gt;characterEncodingFilter&lt;/filter-name&gt;
      &lt;filter-class&gt;org.springframework.web.filter.CharacterEncodingFilter&lt;/filter-class&gt;
      &lt;init-param&gt;
        &lt;param-name&gt;encoding&lt;/param-name&gt;
        &lt;param-value&gt;UTF-8&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;init-param&gt;
        &lt;param-name&gt;forceEncoding&lt;/param-name&gt;
        &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/init-param&gt;
    &lt;/filter&gt;
    &lt;filter-mapping&gt;
      &lt;filter-name&gt;characterEncodingFilter&lt;/filter-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
    &lt;/filter-mapping&gt;
  
   &lt;!-- Handles all requests into the application --&gt; 
    &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;
                  /WEB-INF/dispatcher-servlet.xml
              &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;dispatcher&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  
    &lt;listener&gt;
      &lt;listener-class&gt;
              org.springframework.security.web.session.HttpSessionEventPublisher
          &lt;/listener-class&gt;
    &lt;/listener&gt;
  
  &lt;!-- session timeout --&gt; 
    &lt;session-config&gt;
      &lt;session-timeout&gt;30&lt;/session-timeout&gt;
    &lt;/session-config&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>web-application-context.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"
      xsi:schemaLocation="http://www.springframework.org/schema/beans 
                          http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
                          http://www.springframework.org/schema/context 
                          http://www.springframework.org/schema/context/spring-context-4.2.xsd"&gt;
  
      &lt;!-- Properties loader --&gt;
      &lt;bean id="properties"
          class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;
          &lt;property name="location"
              value="/resources/conf/web-application-conf.properties" /&gt;
      &lt;/bean&gt;
  
      &lt;!-- Application Message Bundle --&gt;
      &lt;bean id="messageSource"
          class="org.springframework.context.support.ReloadableResourceBundleMessageSource"&gt;
          &lt;property name="basename" value="/resources/messages/messages" /&gt;
          &lt;property name="cacheSeconds" value="0" /&gt;
          &lt;property name="fileEncodings" value="UTF-8"/&gt;
          &lt;property name="defaultEncoding" value="UTF-8"/&gt;
  
      &lt;/bean&gt;
  
      &lt;!-- Business bean --&gt;
      &lt;bean id="emailManager" class="fr.lis.xper3.utils.EmailManager"&gt;
          &lt;constructor-arg type="java.lang.String" value="${email.host}" /&gt;
          &lt;constructor-arg type="java.lang.String" value="${email.username}" /&gt;
          &lt;constructor-arg type="java.lang.String" value="${email.password}" /&gt;
          &lt;property name="from" value="${email.from}" /&gt;
          &lt;property name="messageSource" ref="messageSource" /&gt;
      &lt;/bean&gt;
      &lt;bean id="errorMessageManager" class="fr.lis.xper3.utils.ErrorMessageManager"&gt;
          &lt;property name="messageSource" ref="messageSource" /&gt;
      &lt;/bean&gt;
  
      &lt;!-- Configure the multipart resolver --&gt;
      &lt;bean id="multipartResolver"
          class="org.springframework.web.multipart.commons.CommonsMultipartResolver"&gt;
          &lt;!-- one of the properties available; the maximum file size in bytes --&gt;
          &lt;property name="maxUploadSize" value="52428800" /&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>security-application-context.xml</p>
  
  <pre><code>&lt;beans:beans xmlns="http://www.springframework.org/schema/security"
      xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.springframework.org/schema/beans 
                      http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
                      http://www.springframework.org/schema/security 
                      http://www.springframework.org/schema/security/spring-security-4.1.xsd"&gt;
      &lt;!--  http://www.springframework.org/schema/security/spring-security-3.2.xsd --&gt;
  
      &lt;!-- disable all security filtering for resources --&gt;
      &lt;http pattern="/resources/**" security="none" /&gt;
      &lt;http pattern="/favicon.ico" security="none" /&gt;
  
  
      &lt;http use-expressions="true"&gt;
          &lt;intercept-url pattern="/" access="permitAll" /&gt;
          &lt;intercept-url pattern="/auth*" access="permitAll" /&gt;
          &lt;intercept-url pattern="/user*" access="permitAll" /&gt;
          &lt;intercept-url pattern="/admin*" access="hasRole('ROLE_ADMIN')" /&gt;
          &lt;intercept-url pattern="/**" access="hasRole('ROLE_USER')" /&gt;
          &lt;intercept-url pattern="/robot.txt" access="permitAll" /&gt;
          &lt;form-login login-page="/authlogin" default-target-url="/kbEdition"
              authentication-failure-url="/authloginfailed" /&gt;
          &lt;logout logout-success-url="/" /&gt;
  
          &lt;custom-filter position="CONCURRENT_SESSION_FILTER" ref="concurrencyFilter" /&gt;
          &lt;!-- &lt;custom-filter position="FORM_LOGIN_FILTER" ref="myAuthFilter" /&gt; --&gt;
          &lt;session-management
              session-authentication-strategy-ref="sas" /&gt;
          &lt;csrf disabled="true" /&gt;
      &lt;/http&gt;
  
      &lt;beans:bean id="concurrencyFilter" class="org.springframework.security.web.session.ConcurrentSessionFilter"&gt;
          &lt;!-- &lt;beans:property name="sessionRegistry" ref="sessionRegistry" /&gt; SB--&gt;
          &lt;beans:constructor-arg ref="sessionRegistry"/&gt;
      &lt;!--    &lt;beans:property name="expiredUrl" value="/session-expired.htm" /&gt; SB--&gt;
      &lt;/beans:bean&gt;
  
  &lt;!-- SB C New --&gt;
      &lt;beans:bean id="sas" class="org.springframework.security.web.authentication.session.CompositeSessionAuthenticationStrategy"&gt;
          &lt;beans:constructor-arg&gt;
              &lt;beans:list&gt;
                  &lt;beans:bean class="org.springframework.security.web.authentication.session.ConcurrentSessionControlAuthenticationStrategy"&gt;
                      &lt;beans:constructor-arg ref="sessionRegistry"/&gt;
                      &lt;beans:property name="maximumSessions" value="1" /&gt;
                  &lt;/beans:bean&gt;
                  &lt;beans:bean class="org.springframework.security.web.authentication.session.SessionFixationProtectionStrategy"/&gt;
                  &lt;beans:bean class="org.springframework.security.web.authentication.session.RegisterSessionAuthenticationStrategy"&gt;
                      &lt;beans:constructor-arg ref="sessionRegistry"/&gt;
                  &lt;/beans:bean&gt;
              &lt;/beans:list&gt;
          &lt;/beans:constructor-arg&gt;
      &lt;/beans:bean&gt;
  &lt;!-- END C New --&gt;
  
  
      &lt;beans:bean id="sessionRegistry"
          class="org.springframework.security.core.session.SessionRegistryImpl" /&gt;
  
      &lt;beans:bean id="xper3AuthenticationProvider"
          class="fr.lis.xper3.security.Xper3AuthenticationProvider"&gt;&lt;/beans:bean&gt;
  
      &lt;authentication-manager alias="authenticationManager"&gt;&lt;!-- New for rest : alias="authenticationManager" --&gt;
          &lt;authentication-provider ref='xper3AuthenticationProvider'&gt;
          &lt;/authentication-provider&gt;
      &lt;/authentication-manager&gt;
  
  &lt;/beans:beans&gt; 
  </code></pre>
  
  <p>Thanks for your help. Maybe you need others files ?
  Sylvain </p>