Я хочу заменить SessionManagementFilter
по умолчанию своим собственным, но я сталкиваюсь с этим
17:31:32,901 ERROR [[/accounts]] Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Filter beans '<accountsSessionManageFilter>' and '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' have the same 'order' value. When using custom filters, please make sure the positions do not conflict with default filters. Alternatively you can disable the default filters by removing the corresponding child elements from <http> and avoiding the use of <http auto-config='true'>.
Offending resource: ServletContext resource [/WEB-INF/spring-contexts/security.xml]
Кажется, проблема в том, что я использую элемент/атрибут <http>
, который устанавливает фильтр по умолчанию в той же позиции. Я не однако (или если я его непреднамеренно).
Это мое определение контекста безопасности <http>
:
<http use-expressions="true" auto-config="false" entry-point-ref="loginUrlAuthenticationEntryPoint">
<!-- lots of intercept-url definitions (nothing else) -->
<custom-filter position="SESSION_MANAGEMENT_FILTER" ref="accountsSessionManageFilter"/>
<custom-filter position="FORM_LOGIN_FILTER" ref="accountsSsoFilter"/>
</http>
.......
<beans:bean id="accountsSessionManageFilter" class="org.springframework.security.web.session.SessionManagementFilter">
<beans:property name="sessionAuthenticationStrategy" ref="NullAuthenticatedSessionStrategy"/>
</beans:bean>
.......
<bean id="accountsSsoFilter" class="cayetano.core.base.service.impl.spring.filter.SsoUserPassAuthFilter">
<property name="authenticationManager" ref="ssoAuthManager" />
<property name="authenticationFailureHandler" ref="relativeLoginFailureHandler" />
<property name="authenticationSuccessHandler" ref="noopLoginSuccessHandler" />
<property name="authenticationService" ref="basicAuthenticatorService" />
<property name="authorityService" ref="userTypeBasedAuthotiryService" />
</bean>
Так почему же Spring жалуется, что я использую элемент <http>
, который использует фильтр по умолчанию?
Также в документации указано, что <session-management>
— единственный элемент <http>
, использующий фильтр по умолчанию, есть ли другие?
Я использую Spring Security 3.0.
Спасибо,