【发布时间】:2011-12-22 07:59:25
【问题描述】:
我刚刚创建了一个新的 grails 应用程序,
一切都很好,直到我决定
安装 Spring Security Core。
安装 Spring Security Core 后
做一个 s2-quickstart 并点击
grails run-app,它产生了
以下错误:
URI
/test1/
Class
java.lang.IllegalStateException
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.
有人知道如何解决这个问题吗?
如果
你帮忙。我试过寻找
其他网站上的答案,但是
我无法解决它。 :)
顺便说一句,我正在使用:
Spring 安全核心 1.2.4
Grails 2.0.0.RC1
【问题讨论】:
-
URI /test1/ 命中了什么控制器?它正在采取什么行动?您可以从控制器发布的任何代码都会有所帮助,因为它可能是控制器中的某些内容或不在事务会话中的服务。
-
您好,我刚刚搭建了所有控制器的脚手架,除了 Spring Security Core 自身生成的控制器。 /test1/ 是我的应用程序的名称。 :)
-
我刚刚尝试创建一个项目,添加一个域类,在该域上生成所有内容,安装 spring-security-core,运行 s2-quickstart,它工作正常。你试过 grails clean 吗?
-
是的... Grails clean 实际上是我做的第一件事,但没有运气.. 我应您的要求再次尝试,但还是一样.. 嗯.. 一定有什么地方出了问题,我所有的其他应用程序似乎都运行顺利。抱歉,我对 servlet 和其他东西不是很熟悉。 :(
-
我还没有解决这个问题..但是环顾一下grails.jira...似乎有些人和我有同样的问题..jira.grails.org/browse/GPSPRINGSECURITYCORE-98
标签: grails spring-security illegalstateexception