Announcement Announcement Module
No announcement yet.
Custom ExceptionTranslationFilter in Spring 2.0 Page Title Module
Move Remove Collapse
This topic is closed
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Custom ExceptionTranslationFilter in Spring 2.0

    I'm trying to set up a custom ExceptionTranslationFilter in Spring 2.0, and I'm seeing the following error: urationException: Filters ' ionFilter[ order=1400; ]' and ' ionFilter[ order=1400; ]' 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 not avoiding the use of <http auto-config='true'>.

    I have auto-config set to 'false", and as far as I can tell I don't have any child elements in <http> that sets up a default ExceptionTranslationFilter. I can't figure why I'm getting this error.

    Here's my config:

    	<http auto-config="false" entry-point-ref="authenticationEntryPoint">
    		<intercept-url pattern="/acct/" access="ROLE_CUSTOMER" />
    		<jdbc-user-service id="userService" data-source-ref="custDataSource"  
    			users-by-username-query="select cst_email username, cst_password password, '1' enabled from customer where cst_email = ?"  
    			authorities-by-username-query="select cst_email username, 'ROLE_CUSTOMER' authority from customer where cst_email = ?"/>  
    	 <authentication-manager alias="authenticationManager"/> 
    	 <beans:bean id="authenticationProcessingFilter" class=""> 
    	 	<custom-filter position="AUTHENTICATION_PROCESSING_FILTER"/> 
    		<beans:property name="authenticationManager" ref="authenticationManager"/> 
    		<beans:property name="authenticationFailureUrl" value="/" /> 
    		<beans:property name="defaultTargetUrl" value="/" />
    		<beans:property name="targetUrlResolver">
    		          <beans:bean id="targetUrlResolver" class=""/>
    		<beans:property name="rememberMeServices" ref="rememberMeServices" />
    	 <beans:bean id="authenticationEntryPoint" class="">
    		<beans:property name="loginFormUrl" value="/"/>
    	<beans:bean id="logoutFilter" class="">
    		<custom-filter position="LOGOUT_FILTER"/> 
    		<beans:constructor-arg value="/"/> 
    		       <beans:ref bean="rememberMeServices"/>
    		       <beans:bean class="" />
    		       <beans:bean class=""/>
    		<beans:property name="filterProcessesUrl" value="/" />
    	<beans:bean id="rememberMeProcessingFilter" class="">
      		<custom-filter position="REMEMBER_ME_FILTER"/> 
    		<beans:property name="rememberMeServices" ref="rememberMeServices"/>
    		<beans:property name="authenticationManager" ref="authenticationManager" />
    	<beans:bean id="rememberMeServices" class="">
      		<beans:property name="userDetailsService" ref="userService"/>
    		<beans:property name="tokenValiditySeconds" value="60"/>
    		<beans:property name="key" value="springRocks"/>
    	<beans:bean id="rememberMeAuthenticationProvider" class="">
    		<beans:property name="key" value="springRocks"/>
    	<beans:bean id="exceptionTranslationFilter" class="">
    		<custom-filter position="EXCEPTION_TRANSLATION_FILTER"/>
    		<beans:property name="authenticationEntryPoint" ref="authenticationEntryPoint"/>
    		<beans:property name="accessDeniedHandler">
    			<beans:bean class="">
    				<beans:property name="errorPage" value="/network/"/>
    Any help would be greatly appreciated!

    Thanks in advance,


  • #2
    Strictly speaking, you can't supply your own ExceptionTranslationFilter if you're using the namespace. It may work if you put it after the existing one, but I wouldn't recommend relying on that.