title: Spring FilterChainProxy with filterSecurityInterceptor not working correctly?
body: <p>I have a spring application with the config files as shown below. All configs seem correct but while debugging I found that, <strong>during the initialization spring creates two beans for FilterSecurityInterceptor one without any intercept-url rules and the other with the rules that I have specified.</strong> 
  When a request comes, it uses the FilterSecurityInterceptor bean with no intercept-url rules. So I see the following log:</p>
  
  <pre><code>DEBUG FilterSecurityInterceptor:183 - Public object - authentication not attempted
  </code></pre>
  
  <p>But the request URL falls under the intercept URL rule. I debugged and found that this is because the bean used didn't have any intercept rules in <code>httpMethodMap</code> of <code>DefaultFilterInvocationSecurityMetadataSource</code>.
  I am not sure what is wrong here.</p>
  
  <p>Below is the <code>applicationContext-security.xml</code>:</p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:security="http://www.springframework.org/schema/security"
      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-3.2.xsd
                          http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd"
      default-init-method="init"&gt;
  
      &lt;security:authentication-manager alias="authenticationManager"&gt;
          &lt;security:authentication-provider
              user-service-ref="userDetailService"&gt;
          &lt;/security:authentication-provider&gt;
      &lt;/security:authentication-manager&gt;
  
      &lt;alias name="filterChainProxy" alias="springSecurityFilterChain" /&gt;
  
      &lt;bean id="accessDecisionManager"
          class="org.springframework.security.access.vote.AffirmativeBased"&gt;
          &lt;property name="decisionVoters"&gt;
              &lt;list&gt;
                  &lt;bean class="org.springframework.security.access.vote.RoleVoter" /&gt;
                  &lt;bean class="org.springframework.security.access.vote.AuthenticatedVoter" /&gt;
              &lt;/list&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="consoleAuthenticationSuccessHandler"
          class="custom_class"&gt;
          &lt;property name="defaultTargetUrl" value="/loginSuccess.htm" /&gt;
          &lt;property name="targetUrlParameter" value="targetURL" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="consoleAuthenticationFailureHandler"
          class="custom_class"&gt;
          &lt;property name="loginFailureUrl" value="/loginFailure.htm" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="consoleLogoutSuccessHandler"
          class="custom_class"&gt;
          &lt;property name="logoutUrl" value="/loggedout.htm" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="userDetailService"
          class="custom_class"&gt;
      &lt;/bean&gt;
  
      &lt;security:http auto-config="true"
          security-context-repository-ref="securityContextRepository"&gt;
          &lt;security:form-login authentication-failure-url="/loginFailure.htm"
              default-target-url="/loginSuccess.htm"
              authentication-success-handler-ref="consoleAuthenticationSuccessHandler" /&gt;
          &lt;security:logout success-handler-ref="consoleLogoutSuccessHandler" /&gt;
          &lt;security:anonymous enabled="false" /&gt;
          &lt;security:session-management
              session-fixation-protection="none" /&gt;
      &lt;/security:http&gt;
  
      &lt;bean id="filterChainProxy" class="org.springframework.security.web.FilterChainProxy"&gt;
          &lt;security:filter-chain-map path-type="ant"&gt;
              &lt;security:filter-chain pattern="/login.htm*"
                  filters="none" /&gt;
              &lt;security:filter-chain pattern="/**"
                  filters="securityContextFilter, logoutFilter, formLoginFilter, servletApiFilter, exceptionTranslator, filterSecurityInterceptor" /&gt;
          &lt;/security:filter-chain-map&gt;
      &lt;/bean&gt;
  
      &lt;bean id="securityContextRepository"
          class="org.springframework.security.web.context.HttpSessionSecurityContextRepository" /&gt;
  
      &lt;bean id="securityContextFilter"
          class="org.springframework.security.web.context.SecurityContextPersistenceFilter"&gt;
          &lt;property name="securityContextRepository" ref="securityContextRepository" /&gt;
      &lt;/bean&gt;
      &lt;bean id="logoutFilter"
          class="org.springframework.security.web.authentication.logout.LogoutFilter"&gt;
          &lt;constructor-arg ref="consoleLogoutSuccessHandler"
              index="0"
              type="org.springframework.security.web.authentication.logout.LogoutSuccessHandler" /&gt;
          &lt;constructor-arg&gt;
              &lt;list&gt;
                  &lt;bean
                      class="org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler" /&gt;
              &lt;/list&gt;
          &lt;/constructor-arg&gt;
      &lt;/bean&gt;
  
      &lt;bean id="servletApiFilter"
          class="org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter" /&gt;
  
      &lt;bean id="exceptionTranslator"
          class="org.springframework.security.web.access.ExceptionTranslationFilter"&gt;
          &lt;property name="authenticationEntryPoint"&gt;
              &lt;bean
                  class="org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint"&gt;
                  &lt;property name="loginFormUrl" value="/login.jsp" /&gt;
              &lt;/bean&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="formLoginFilter"
          class="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter"&gt;
          &lt;property name="authenticationManager" ref="authenticationManager" /&gt;
          &lt;property name="authenticationSuccessHandler" ref="consoleAuthenticationSuccessHandler" /&gt;
          &lt;property name="authenticationFailureHandler" ref="consoleAuthenticationFailureHandler" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="filterSecurityInterceptor"
          class="org.springframework.security.web.access.intercept.FilterSecurityInterceptor"&gt;
          &lt;property name="securityMetadataSource"&gt;
              &lt;security:filter-security-metadata-source&gt;
                  &lt;security:intercept-url pattern="/login.htm*"
                      access="ROLE_ANONYMOUS" /&gt;
                  &lt;security:intercept-url pattern="/**"
                      access="ROLE_USER,ROLE_ADMIN" /&gt;
              &lt;/security:filter-security-metadata-source&gt;
          &lt;/property&gt;
          &lt;property name="accessDecisionManager" ref="accessDecisionManager" /&gt;
          &lt;property name="authenticationManager" ref="authenticationManager" /&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>Appreciate any help here.</p>