Results 1 to 7 of 7

Thread: Spring Security on Websphere 7 throws Servlet Exception: Failed to initialize Filter

Threaded View

  1. #1

    Unhappy Spring Security on Websphere 7 throws Servlet Exception: Failed to initialize Filter

    I have an application bundled with Spring Security and it works perfectly when deployed on a Tomcat server.

    However, when the same WAR is deployed to Websphere; application fails to start giving the following error.

    Code:
    javax.servlet.ServletException: [springSecurityFilterChain]: Could not be initialized.
    The status of the application in Websphere shows deployed and started.

    Using Spring Security 3.0.7 and Websphere 7.0.0.17

    Here's my web.xml

    Code:
    <!-- Spring Security configuration Start-->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
            /WEB-INF/app-servlet.xml,
            /WEB-INF/security-app-context.xml
        </param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <filter>
        <filter-name>springSecurityFilterChain</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>springSecurityFilterChain</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <!-- Spring Security configuration End-->
    I am using PreAuth Filter for Siteminder. Here's my security-app-context.xml:

    Code:
     <http  use-expressions="true">
            <intercept-url pattern="/admin/**" access="hasRole('ROLE_ADMIN')" />
            <intercept-url pattern="/403.jsp" access="permitAll" />
            <!-- Allow non-secure access to static resources  -->
            <intercept-url pattern="/css/**" filters="none" />
            <intercept-url pattern="/images/**" filters="none" />
    
            <custom-filter ref="siteminderFilter" position="PRE_AUTH_FILTER"/>
    
    <!--        <form-login  /> -->
            <logout logout-success-url="/index.jsp"/>
        </http>
    
        <beans:bean id="siteminderFilter" class="org.springframework.security.web.authentication.preauth.RequestHeaderAuthenticationFilter">
            <beans:property name="principalRequestHeader" value="SM_USER"/>
            <beans:property name="authenticationManager" ref="authenticationManager" />
            <beans:property name="exceptionIfHeaderMissing" value="false"/>
        </beans:bean>
    
        <beans:bean id="AdminUserDetailsService" class="com.fw.security.auth.MyUserDetailsService">
        </beans:bean>
    
        <beans:bean id="preauthAuthProvider" class="org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationProvider">
            <beans:property name="preAuthenticatedUserDetailsService">
                <beans:bean id="userDetailsServiceWrapper" class="org.springframework.security.core.userdetails.UserDetailsByNameServiceWrapper">
                    <beans:property name="userDetailsService" ref="AdminUserDetailsService"/>
                </beans:bean>
            </beans:property>
        </beans:bean>
    
        <authentication-manager alias="authenticationManager">
          <authentication-provider ref="preauthAuthProvider" />
        </authentication-manager>
    Last edited by nirmaljpatel; Nov 24th, 2011 at 02:12 AM. Reason: correct version number

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •