dhore
dhore

Reputation: 83

No thread-bound Exception after installing grails profiler plugin

After I installed the profiler plugin (http://grails.org/plugin/profiler) I started getting the following error for every request to my server:

2012-03-01 14:57:42,224 ERROR: [[default]] Servlet.service() for servlet default threw exception
java.lang.IllegalStateException: 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.
    at org.springframework.web.context.request.RequestContextHolder.currentRequestAttributes(RequestContextHolder.java:131)
    at org.codehaus.groovy.grails.web.util.WebUtils.retrieveGrailsWebRequest(WebUtils.java:497)
    at org.codehaus.groovy.grails.plugins.springsecurity.AnnotationFilterInvocationDefinition.determineUrl(AnnotationFilterInvocationDefinition.java:63)
    at org.codehaus.groovy.grails.plugins.springsecurity.AbstractFilterInvocationDefinition.getAttributes(AbstractFilterInvocationDefinition.java:77)
    at org.springframework.security.access.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:171)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:106)

I can paste the full exception if desired. If I uninstall the plugin, the error disappears.

I am running grails 1.3.7

I searched for related issues, and this is the closest I could find: http://padcom13.blogspot.com/2011/12/grails-heroku-and-spring-security-core.html I attempted the fix Padcom suggested, but it didn't seem to work here.

Has anyone run into this issue or have some idea how to fix it?

Upvotes: 0

Views: 869

Answers (2)

dhore
dhore

Reputation: 83

Okay, so the problem here was a little annoying to figure out. Burt was on the right track, it was related to webxml being installed. It seems like when its installed, spring-security-core version 1.1.3 was causing the error. When I updated to 1.2.7 (as suggested by Burt in this thread: http://grails.1312388.n4.nabble.com/No-thread-bound-request-error-with-Spring-security-ldap-plugin-on-Grails-2-td4270779.html ) the problem went away and I was able to install profiler without any issues.

So, the oddity here was that spring-security-core 1.1.3 only seems to cause this exception when webxml is installed (any version).

Upvotes: 0

Burt Beckwith
Burt Beckwith

Reputation: 75681

I fixed this earlier this week with version 0.4 of the plugin. It depends on the webxml plugin, but that should be automatically installed with version 0.4. If not you can manually install it.

Upvotes: 2

Related Questions