|
I am attempting to use grails spring social plugin and running with the showcase application of the project.
While the sample was written with grails 1.3.7, I have upgraded to 2.0.4. On first run, after upgrade and jumping through a few hoops, the application works, but subsequent runs get this error. 2012-07-04 12:04:33,544 ERROR org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/spring-social-showcase].[gsp]:271 Servlet.service() for servlet [gsp] in context with path [/spring-social-showcase] 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:651) at org.codehaus.groovy.grails.plugins.springsecurity.AnnotationFilterInvocationDefinition.determineUrl(AnnotationFilterInvocationDefinition.java:69) at org.codehaus.groovy.grails.plugins.springsecurity.AbstractFilterInvocationDefinition.getAttributes(AbstractFilterInvocationDefinition.java:80) at org.codehaus.groovy.grails.plugins.springsecurity.AnnotationFilterInvocationDefinition.getAttributes(AnnotationFilterInvocationDefinition.java) at org.springframework.security.access.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:172) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:106) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:112) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187) at org.codehaus.groovy.grails.plugins.springsecurity.RequestHolderAuthenticationFilter.doFilter(RequestHolderAuthenticationFilter.java:40) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) at org.codehaus.groovy.grails.plugins.springsecurity.MutableLogoutFilter.doFilter(MutableLogoutFilter.java:79) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:168) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.codehaus.groovy.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:69) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:680) Any clues as to why subsequent runs will fail when the initial run succeeded? How do I go about debugging this? I threw it up on hub and the error is reproducible (https://github.com/berinle/grails-spring-social-showcase). Any help will be appreciated. Thanks. |
|
On 04/07/2012 17:23, groovybayo wrote:
> I threw it up on hub and the error is reproducible ( > https://github.com/berinle/grails-spring-social-showcase > https://github.com/berinle/grails-spring-social-showcase ). Any help will be > appreciated. In your BuildConfig you have: compile(":spring-security-core:1.2.4") I suggest you upgrade to a newer version. Ian -- Ian Roberts | Department of Computer Science [hidden email] | University of Sheffield, UK --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
Upgraded to :spring-security-core:1.2.7.3 and still hitting the same error. (Bangs head on the wall)
|
|
It's probably the webxml plugin. It should be transitively installed but in some cases isn't - add an explicit dep for that with 'compile ":webxml:1.4.1"'
Burt
|
|
Thanks Burt. Unfortunately, that still doesn't work. Running out of ideas :(
|
|
Can you email me (off-list) the web.xml from your war?
Burt
|
|
Ok, looking at the web.xml it's clear that the problem is that the Spring Security filter-mapping element is before the Grails filter-mapping element and it has to be the other way around. That's the purpose of the webxml plugin, so it looks like it's not properly installed. Look at your installed plugins folder (under .grails/2.0.4/projects/grails-spring-social-showcase/plugins) and make sure the plugins are there and that the latest versions of the Spring Security, webxml, and resources plugins are installed. The BuildConfig.groovy code should be
compile ":resources:1.1.6" compile ":spring-security-core:1.2.7.3" compile ":webxml:1.4.1" Another thing to try is run 'grails clean' and delete the .grails/2.0.4/projects/grails-spring-social-showcase folder and run 'grails compile' to reinstall the plugins. Check the web.xml file and make sure that the filter-mapping element for "springSecurityFilterChain" is after the one for "grailsWebRequest" (the filter element order isn't important, just filter-mapping). Burt
|
|
Wow, thanks Burt! That did the trick. You are a life saver!
It will be ideal if this bug were addressed at the spring security plugin level so that one doesn't have to explicitly add the webxml plugin to get around this. Also, I was under the impression I saw some tweet from @graemerocher a long time back with regards to deleting ~/.grails/<version>/projects/ when a grails clean is applied. That will surely be handy. If there isn't already a plugin for this, I could write one (if you think it is needed) until it is addressed (if at all) in grails core. In any case, thanks a million! |
|
In reply to this post by burtbeckwith
Hi burt, i newly cloned a grails project from github and when running it went into the "No thread-bound request found error" . i try the solutions around this and even trying your's (that seem to have resolved the problem to other persons) i have the same issue:
as you suggested i put this in to BuidConfig.groovy: plugins { //here go your plugin dependencies //runtime ':aws:1.2.12.2' compile ":resources:1.1.6" compile ":spring-security-core:1.2.4" compile ":webxml:1.4.1" } i even uninstalled the plugins then fired "grails clean" then "grails compile" but i still having the same error message as followed: ***************** 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:64) at .... etc ... ***************** In case its matter these are plugins ive installed: -------------------------------------------- aws 1.2.12.2 bean-fields 1.0.RC5 bubbling 2.1.3 burning-image 0.5.0 calendar 1.2.1 class-diagram 0.5.2 code-coverage 1.2.5 codenarc 0.17 cometd 0.2.2 commentable 0.7.7 create-domain-uml 0.5 email-confirmation 1.0.5 executor 0.3 facebook-graph 0.12 google-visualization0.5 grails-ui 1.2 hibernate 1.3.7 invitation-only 1.1 mail 1.0 modalbox 0.4 quartz 0.4.2 resources 1.1.6 rest 0.7 richui 0.8 spring-security-core1.2.4 spring-security-facebook0.6.2 spring-social-core 0.1.31 spring-social-facebook0.1.32 spring-social-twitter0.1.31 stripe 1.0 tomcat 1.3.7 webxml 1.4.1 yui 2.8.2 yui-minify-resources0.1.5 zk 1.0.6 -------------------------------------------- Any idea about what im doing wrong ?? anyone had the same issue and have not solved it despite the suggested solution?? |
|
You need a newer version of spring-security-core than 1.2.4 - try updating to the latest (1.2.7.3).
Burt
|
|
@Burt
great!! it work like a charm !!! thankx a lot bro the version updating solve my problem thkx |
| Powered by Nabble | Edit this page |
