Quantcast

No thread-bound request error with Spring-security-ldap plugin on Grails 2

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

No thread-bound request error with Spring-security-ldap plugin on Grails 2

Sam Carr
I've just installed the spring-security-ldap plugin, having been happily running with spring-security-core and grails 2 for some time. Unfortunately now the dreaded "java.lang.IllegalStateException: No thread-bound request found..." exception is back for all requests to my site.

I see I'm not the only person running into this as there's a fresh SO post on the same topic from just a few hours ago (no answers yet):
http://stackoverflow.com/questions/8761782/grails-app-with-spring-security-causing-500-filter-error-on-was7

I'll continue to look into the issue, having had to do quite a bit of fighting with the same exception when first moving to grails 2 before webxml, ssc and resources plugins fully found their collective feet. What's weird is that having uninstalled the ldap plugin my app is still suffering from the same error, proving that I really don't understand what goes on beneath the grails covers!

Sam

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: No thread-bound request error with Spring-security-ldap plugin on Grails 2

burtbeckwith
Make sure you have the latest version of Spring Security Core (1.2.7), Resources (1.1.6) and WebXml (1.4.1).

Burt

On Friday, January 06, 2012 08:48:55 PM Sam Carr wrote:
> I've just installed the spring-security-ldap plugin, having been happily running with spring-security-core and grails 2 for some time. Unfortunately now the dreaded "java.lang.IllegalStateException: No thread-bound request found..." exception is back for all requests to my site.
>
> I see I'm not the only person running into this as there's a fresh SO post on the same topic from just a few hours ago (no answers yet):
> http://stackoverflow.com/questions/8761782/grails-app-with-spring-security-causing-500-filter-error-on-was7
>
> I'll continue to look into the issue, having had to do quite a bit of fighting with the same exception when first moving to grails 2 before webxml, ssc and resources plugins fully found their collective feet. What's weird is that having uninstalled the ldap plugin my app is still suffering from the same error, proving that I really don't understand what goes on beneath the grails covers!
>
> Sam


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: No thread-bound request error with Spring-security-ldap plugin on Grails 2

Sam Carr
Thanks Burt! I was on 1.2.6 and 1.1.5 respectively. I assume that I shouldn't explicitly list webxml and it will be pulled in for me as a transitive dependency.

That got my app back on its feet so now I'll try and get the LDAP plugin working. Brace yourself... :-)

Sam

On 6 Jan 2012, at 21:36, Burt Beckwith wrote:

> Make sure you have the latest version of Spring Security Core (1.2.7), Resources (1.1.6) and WebXml (1.4.1).
>
> Burt
>
> On Friday, January 06, 2012 08:48:55 PM Sam Carr wrote:
>> I've just installed the spring-security-ldap plugin, having been happily running with spring-security-core and grails 2 for some time. Unfortunately now the dreaded "java.lang.IllegalStateException: No thread-bound request found..." exception is back for all requests to my site.
>>
>> I see I'm not the only person running into this as there's a fresh SO post on the same topic from just a few hours ago (no answers yet):
>> http://stackoverflow.com/questions/8761782/grails-app-with-spring-security-causing-500-filter-error-on-was7
>>
>> I'll continue to look into the issue, having had to do quite a bit of fighting with the same exception when first moving to grails 2 before webxml, ssc and resources plugins fully found their collective feet. What's weird is that having uninstalled the ldap plugin my app is still suffering from the same error, proving that I really don't understand what goes on beneath the grails covers!
>>
>> Sam
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: No thread-bound request error with Spring-security-ldap plugin on Grails 2

Dylan Bijnagte
I had the post on SO.
So far I have been unable to resolve the issue even though have all of my plugins up to date.
If I disable springsecurity in my Config.groovy I am able to use my app however site mesh is not working properly which leads me to believe that the filters are not functioning properly.  I verified that the websphere webcontainer custom property "com.ibm.ws.webcontainer.invokeFiltersCompatibilty" is correct in the server.xml and that the web.xml has all of the filters defined.

Dylan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: No thread-bound request error with Spring-security-ldap plugin on Grails 2

Dylan Bijnagte
this is my web.xml:
<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<display-name>/StatusWeb-production-0.1</display-name>
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>/WEB-INF/applicationContext.xml</param-value>
	</context-param>
	<context-param>
		<param-name>webAppRootKey</param-name>
		<param-value>StatusWeb-production-0.1</param-value>
	</context-param>
	<context-param>
		<param-name>sample</param-name>
		<param-value>Sample Value</param-value>
	</context-param>
	<filter>
		<filter-name>sitemesh</filter-name>
		<filter-class>org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter</filter-class>
	</filter>
	<filter>
		<filter-name>DeclaredResourcesPluginFilter</filter-name>
		<filter-class>org.grails.plugin.resource.ProcessingFilter</filter-class>
	</filter>
	<filter>
		<filter-name>AdHocResourcesPluginFilter</filter-name>
		<filter-class>org.grails.plugin.resource.ProcessingFilter</filter-class>
		<init-param>
			<param-name>adhoc</param-name>
			<param-value>true</param-value>
		</init-param>
	</filter>
	<filter>
		<filter-name>charEncodingFilter</filter-name>
		<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
		<init-param>
			<param-name>targetBeanName</param-name>
			<param-value>characterEncodingFilter</param-value>
		</init-param>
		<init-param>
			<param-name>targetFilterLifecycle</param-name>
			<param-value>true</param-value>
		</init-param>
	</filter>
	<filter>
		<filter-name>urlMapping</filter-name>
		<filter-class>org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter</filter-class>
	</filter>
	<filter>
		<filter-name>hiddenHttpMethod</filter-name>
		<filter-class>org.codehaus.groovy.grails.web.filters.HiddenHttpMethodFilter</filter-class>
	</filter>
	<filter>
		<filter-name>grailsWebRequest</filter-name>
		<filter-class>org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>charEncodingFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
	<filter-mapping>
		<filter-name>DeclaredResourcesPluginFilter</filter-name>
		<url-pattern>/static/*</url-pattern>
	</filter-mapping>
	<filter-mapping>
		<filter-name>AdHocResourcesPluginFilter</filter-name>
		<url-pattern>/images/*</url-pattern>
	</filter-mapping>
	<filter-mapping>
		<filter-name>AdHocResourcesPluginFilter</filter-name>
		<url-pattern>*.css</url-pattern>
	</filter-mapping>
	<filter-mapping>
		<filter-name>AdHocResourcesPluginFilter</filter-name>
		<url-pattern>*.js</url-pattern>
	</filter-mapping>
	<filter-mapping>
		<filter-name>hiddenHttpMethod</filter-name>
		<url-pattern>/*</url-pattern>
		<dispatcher>FORWARD</dispatcher>
		<dispatcher>REQUEST</dispatcher>
	</filter-mapping>
	<filter-mapping>
		<filter-name>grailsWebRequest</filter-name>
		<url-pattern>/*</url-pattern>
		<dispatcher>FORWARD</dispatcher>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>ERROR</dispatcher>
	</filter-mapping>
	<filter-mapping>
		<filter-name>sitemesh</filter-name>
		<url-pattern>/*</url-pattern>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>ERROR</dispatcher>
	</filter-mapping>
	<filter-mapping>
		<filter-name>urlMapping</filter-name>
		<url-pattern>/*</url-pattern>
		<dispatcher>FORWARD</dispatcher>
		<dispatcher>REQUEST</dispatcher>
	</filter-mapping>
	<listener>
		<listener-class>org.codehaus.groovy.grails.plugins.log4j.web.util.Log4jConfigListener</listener-class>
	</listener>
	<listener>
		<listener-class>org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener</listener-class>
	</listener>
	<servlet>
		<servlet-name>grails</servlet-name>
		<servlet-class>org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>
	<servlet>
		<servlet-name>gsp</servlet-name>
		<servlet-class>org.codehaus.groovy.grails.web.pages.GroovyPagesServlet</servlet-class>
	</servlet>
	<servlet>
		<servlet-name>grails-errorhandler</servlet-name>
		<servlet-class>org.codehaus.groovy.grails.web.servlet.ErrorHandlingServlet</servlet-class>
	</servlet>
	<servlet-mapping>
		<servlet-name>gsp</servlet-name>
		<url-pattern>*.gsp</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>grails-errorhandler</servlet-name>
		<url-pattern>/grails-errorhandler</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>grails</servlet-name>
		<url-pattern>*.dispatch</url-pattern>
	</servlet-mapping>
	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
		<welcome-file>index.jsp</welcome-file>
		<welcome-file>index.gsp</welcome-file>
	</welcome-file-list>
	<error-page>
		<error-code>500</error-code>
		<location>/grails-errorhandler</location>
	</error-page>
	<jsp-config>
		<taglib>
			<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
			<taglib-location>/WEB-INF/tld/c.tld</taglib-location>
		</taglib>
		<taglib>
			<taglib-uri>http://java.sun.com/jsp/jstl/fmt</taglib-uri>
			<taglib-location>/WEB-INF/tld/fmt.tld</taglib-location>
		</taglib>
		<taglib>
			<taglib-uri>http://www.springframework.org/tags</taglib-uri>
			<taglib-location>/WEB-INF/tld/spring.tld</taglib-location>
		</taglib>
		<taglib>
			<taglib-uri>http://grails.codehaus.org/tags</taglib-uri>
			<taglib-location>/WEB-INF/tld/grails.tld</taglib-location>
		</taglib>
	</jsp-config>
</web-app>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: No thread-bound request error with Spring-security-ldap plugin on Grails 2

Dylan Bijnagte
In reply to this post by Dylan Bijnagte
my problem turned out to be a websphere specific one.
When deploying a war to websphere it gets wrapped in an ear and during that process websphere examines the web.xml and under certain circumstances it generates a web_merged.xml which it uses in place of the provided web.xml.
In the generated deployement descriptor the filter-mapping elements are out of order (Thanks IBM). In order to solve that problem I had to run the grails install-templates command and modify the web.xml template so that the wep-app element includes a metadata-complete="true" attribute like this:

<web-app version="2.5"
         metadata-complete="true"
         xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
/raw>

After that websphere stopped messing with my web.xml

Dylan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: No thread-bound request error with Spring-security-ldap plugin on Grails 2

raghavofss
Hi,

Hi ,

I have an application of which I create a ear and try to deploy the same in Websphere 7.0.0.9,7.0.17,7.0.0.21. On deployment the console hangs for a long time and does not come up.
I tried to refresh the screen and kill the IE process.When i relogin into the console and check for the application status I see the same is down.Even after repeated attempts of bring it up it is not happening.
For the sake of trying I bring the web sphere profile down and then the profile itself goes down due to java.lang.OutOfMemoryError.
I have gone through some posts and added the entry in my web.xml (metadata-complete="true") after this the server starts working as expected.
Please help me understand why the web_merged.xml gets generated and how is it affecting my application.
The significant change that we have made recently is changing the xml version to 2.5

Thanks & Regards,
Raghav
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: No thread-bound request error with Spring-security-ldap plugin on Grails 2

Dylan Bijnagte
Does your EAR contain everything it needs?
Your EAR's META-INF folder needs to contain five things:
MANIFEST.MF
application.xml
ibm-application-bnd.xml
was.policy
was.webmodule

I copied them from an EAR generated by RAD and modified the application.xml
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: No thread-bound request error with Spring-security-ldap plugin on Grails 2

raghavofss
Hi Dylan,

I am using an ant task to built my ear file and have verified  for the files You had pointed out.
MANIFEST.MF
application.xml
ibm-application-bnd.xml
I tried downgrading the web app version from 2.5 and on successful  deployment I have traced out the above  files being available
Could You please help me with the other two files
was.policy
was.webmodule

From my analysis i think at the deployment stage the tag libraries or the annotations that are used in the code are taking time to be loaded.Please help me understand how websphere 7 with web xml version 2.5 handles interpretation of annotations and tag libraries loading.
But what is confusing is on deployment the application is always down,then this loading does not make sense.
Please provide Your valuable inputs on  the same
Loading...