title: Spring Security, always redirect to Login page
body: <p>I have a serious problem...
  i'm trying to create an application on weblogic 11g, with Spring 3, Hibernate 3 and AngularJS.
  for 2 days, i was in deep difficulty to make my app working.
  finally, i was able to make this work !</p>
  
  <p>but, the problem is when i authenticate myself, and i navigate on the app, on each page, 
  spring security redirect me on the login page... and i really don't know why...</p>
  
  <p><strong>Web.xml :</strong></p>
  
  <pre><code>&lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:jsp="http://java.sun.com/xml/ns/javaee/jsp" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"&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/spring/spring.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.web.context.ContextLoaderListener&lt;/listener-class&gt;
    &lt;/listener&gt;
    &lt;listener&gt;
      &lt;listener-class&gt;com.bla.Init&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/spring/spring.xml
          &lt;/param-value&gt;
    &lt;/context-param&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;filter&gt;
      &lt;filter-name&gt;encodingFilter&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;encodingFilter&lt;/filter-name&gt;
      &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt;
    &lt;/filter-mapping&gt;
    &lt;jsp-config&gt;
      &lt;jsp-property-group&gt;
        &lt;url-pattern&gt;*.jsp&lt;/url-pattern&gt;
        &lt;page-encoding&gt;UTF-8&lt;/page-encoding&gt;
        &lt;trim-directive-whitespaces&gt;true&lt;/trim-directive-whitespaces&gt;
      &lt;/jsp-property-group&gt;
    &lt;/jsp-config&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p><strong>Spring.xml</strong></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"
         xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                             http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
                             http://www.springframework.org/schema/context http://www.springframework.org/schema/task/spring-context-3.0.xsd"&gt;
  
      &lt;!-- Basic Configurations --&gt;
      &lt;context:annotation-config/&gt;
  
      &lt;context:component-scan base-package="test.model"/&gt;
      &lt;context:component-scan base-package="test.repository"/&gt;
      &lt;context:component-scan base-package="test.service"/&gt;
      &lt;context:component-scan base-package="test.controller"/&gt;
  
      &lt;!-- SpringMVC --&gt;
      &lt;import resource="spring-mvc.xml"/&gt;
  
      &lt;!-- SpringData --&gt;
      &lt;import resource="spring-jpa.xml"/&gt;
  
      &lt;!-- SpringSecurity --&gt;
      &lt;import resource="spring-security.xml"/&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p><strong>spring-security.xml</strong> :</p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:security="http://www.springframework.org/schema/security"
         xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
         http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd"&gt;
  
      &lt;security:global-method-security secured-annotations="enabled" /&gt;
  
      &lt;security:http auto-config="true" use-expressions="true" access-denied-page="/login?error=403"&gt;
  
          &lt;security:intercept-url pattern="/" access="permitAll" /&gt;
          &lt;security:intercept-url pattern="/protected/**" access="isFullyAuthenticated()" /&gt;
  
          &lt;security:form-login login-page="/login" authentication-failure-url="/login?error=403" default-target-url="/protected/home" /&gt;
  
          &lt;security:logout invalidate-session="true" logout-success-url="/login" logout-url="/logout" /&gt;
      &lt;/security:http&gt;
  
      &lt;security:authentication-manager&gt;
          &lt;security:authentication-provider&gt;
              &lt;security:jdbc-user-service
                      data-source-ref="myRapportDataSource"
                      users-by-username-query="select nni, password, enabled from system_user where nni = ?"
                      authorities-by-username-query="select u.nni as login, u.user_role as role from system_user u where u.nni = ?" /&gt;
          &lt;/security:authentication-provider&gt;
      &lt;/security:authentication-manager&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>i add the <strong>spring-mvc.xml</strong> too :</p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:mvc="http://www.springframework.org/schema/mvc"
         xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                             http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"&gt;
  
      &lt;mvc:annotation-driven/&gt;
      &lt;mvc:default-servlet-handler/&gt;
  
      &lt;!-- Login Interceptor --&gt;
      &lt;mvc:interceptors&gt;
          &lt;mvc:interceptor&gt;
              &lt;mvc:mapping path="/protected/**"/&gt;
              &lt;bean class="gram.interceptor.LoginInterceptor"/&gt;
          &lt;/mvc:interceptor&gt;
          &lt;!-- workaround to fix IE8 problem --&gt;
          &lt;bean id="webContentInterceptor"
                class="org.springframework.web.servlet.mvc.WebContentInterceptor"&gt;
              &lt;property name="cacheSeconds" value="0"/&gt;
              &lt;property name="useExpiresHeader" value="true"/&gt;
              &lt;property name="useCacheControlHeader" value="true"/&gt;
              &lt;property name="useCacheControlNoStore" value="true"/&gt;
          &lt;/bean&gt;
      &lt;/mvc:interceptors&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>at first, this app was on Tomcat 6 and worked fine, but i have to migrate it on weblogic 10.3.6</p>
  
  <p>any ideas ? i'm almost despered...</p>
  
  <p>thank you very much every one to take a look at my problem</p>