Announcement Announcement Module
Collapse
No announcement yet.
Spring security + Websphere 6 Error 500 springSecurityFilterChain is unavailable Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring security + Websphere 6 Error 500 springSecurityFilterChain is unavailable

    Hello,

    i'v problem with my configuration, like lot of people, i've checked :
    • that i'm in 6.1.0.25 (for fix patch)
    • i've set property : com.ibm.ws.webcontainer.invokefilterscompatibility = true

    So i've this stacktrace and i don't understand...

    Code:
    [Servlet Error]-[Filter [springSecurityFilterChain]: filter is unavailable.]: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.userSettings': Scope 'session' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request? If you are actually operating within a web request and still receive this message,your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
    Caused by: java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request? If you are actually operating within a web request and still receive this message,your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
            at org.springframework.web.context.request.RequestContextHolder.currentRequestAttributes(RequestContextHolder.java:102)
            at org.springframework.web.context.request.SessionScope.get(SessionScope.java:88)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:283)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
            at org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:33)
            at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.getTarget(Cglib2AopProxy.java:662)
            at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:612)
            at com.sncf.myproject.domain.Utilisateur$$EnhancerByCGLIB$$f06a9e26.setCodeUtilisateur(<generated>)
            at com.sncf.myproject.web.security.UserDetailsServiceImpl.loadUserByUsername(UserDetailsServiceImpl.java:57)
            at com.sncf.myproject.web.security.MyprojectUserDetailsContextMapper.mapUserFromContext(MyprojectUserDetailsContextMapper.java:33)
            at org.springframework.security.providers.ldap.LdapAuthenticationProvider.authenticate(LdapAuthenticationProvider.java:233)
            at org.springframework.security.providers.ProviderManager.doAuthentication(ProviderManager.java:188)
            at org.springframework.security.AbstractAuthenticationManager.authenticate(AbstractAuthenticationManager.java:46)
            at org.springframework.security.ui.webapp.AuthenticationProcessingFilter.attemptAuthentication(AuthenticationProcessingFilter.java:82)
            at org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:258)
            at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
            at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
            at org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:89)
            at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
            at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
            at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
            at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)                    11h41mn07s-20/08/2010
            at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)      11h43mn02s-20/08/2010
            at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175)                         11h43mn03s-20/08/2010
            at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:138)
            at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
            at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
            at com.sncf.common.web.filters.UTF8Filter.doFilter(UTF8Filter.java:24)
            at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
            at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
            at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
            at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:837)
            at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:747)
            at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:700)
            at com.ibm.ws.wswebcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:115)
            at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.invokeFilters(DefaultExtensionProcessor.java:849)
            at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:785)
            at com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:113)
            at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3507)
            at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:269)
            at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:815)
            at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1466)
            at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:122)
            at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
            at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
            at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:267)
            at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
            at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
            at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
            at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
            at com.ibm.io.async.AsyncChannelFuture$1.run(AsyncChannelFuture.java:205)
            at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497)
    my web.xml is like this :
    Code:
    <!--	 Filtres utilisÚs par Spring Security 2 pour la sÚcuritÚ -->
    	
    	<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>
    
    <!-- Chargement du contexte Spring -->
    	<listener>
    		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    	</listener>
    
    	<!-- Listener Spring pour que les beans des scope session et request
    		soient accessibles dans la webapp -->
    	<listener>
    		<listener-class>org.springframework.web.context.request.RequestContextListener
    		</listener-class>
    	</listener>
    Thanks for your help

  • #2
    i'v had another filter in firts and it works fine !

    Code:
    	  <filter>
    		<filter-name>requestContextFilter</filter-name>
    		<filter-class>org.springframework.web.filter.RequestContextFilter</filter-class>
    	</filter>
    	<filter-mapping>
    		<filter-name>requestContextFilter</filter-name>
    		<url-pattern>/*</url-pattern>
    	</filter-mapping>
    1. WAS must be at fixpack 6.1.0.11 or higher.

    2. A custom property must be set on the web container so WAS will play nicely with filters that decide to commit a response instead of passing responsibility along to the next filter in the chain. com.ibm.ws.webcontainer.invokefilterscompatibility = true

    3. User different filter :
    Code:
    	  <filter>
    		<filter-name>requestContextFilter</filter-name>
    		<filter-class>org.springframework.web.filter.RequestContextFilter</filter-class>
    	</filter>
    	<filter-mapping>
    		<filter-name>requestContextFilter</filter-name>
    		<url-pattern>/*</url-pattern>
    	</filter-mapping>
    
    <!--	 Filtres utilisÚs par Spring Security 2 pour la sÚcuritÚ -->
    
    	<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>  
    
    <!-- Chargement du contexte Spring -->
    	<listener>
    		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    	</listener>
    
    	<!-- Listener Spring pour que les beans des scope session et request
    		soient accessibles dans la webapp -->
    	<listener>
    		<listener-class>
    			org.springframework.web.context.request.RequestContextListener
    		</listener-class>
    	</listener>
    thanks

    Comment

    Working...
    X