Search code examples
grailsspring-securitywebsphere-7

Grails app with spring-security causing 500 filter error on WAS7


I have had an earlier version of this app deployed with the same WebSphere configuration but I was on grails 1.3.7 with out the resources or webxml plugins.

I am able to deploy to Tomcat but when I deploy the same war to WebSphere I am getting the following error when I try to access the app:

Error 500: No thread-bound request found: Are you referring to request attributes outside       of an actual web request, or processing a request outside of the originally receiving thread? 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.
Exception Message: No thread-bound request found: Are you referring to request attributes   outside of an actual web request, or processing a request outside of the originally receiving thread? 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: Filter [springSecurityFilterChain]: filter is unavailable.

Grails version: 2.0.0 Groovy version: 1.8.4 JVM version: 1.6.0_29

INSTALLED PLUGINS core - 2.0.0 resources - 1.1.6 webxml - 1.4.1 servlets - 2.0.0 springSecurityCore - 1.2.7 springSecurityLdap - 1.0.5

I have set the invokeFiltersCompatibility custom property on the webcontainer to true.


Solution

  • If you use the attribute: metadata-complete="true" in your web.xml, Websphere will leave your web.xml alone. In order to to edit your web.xml, you have to use the grails "install-templates" command to get a working copy of your web.xml file.

    Also see: http://www.experts-exchange.com/Software/Server_Software/Application_Servers/Java/IBM_Websphere/Q_26625087.html