【问题标题】:grails 2.0.0.RC1 app fails on Ubuntugrails 2.0.0.RC1 应用程序在 Ubuntu 上失败
【发布时间】:2012-01-02 10:34:23
【问题描述】:

我有一个在 Windows 上运行良好的 Grails 2.0.0.RC1 应用程序。但是,当我尝试在 Ubuntu 下运行它时,每当我尝试加载页面时都会收到以下错误消息:

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.

我对上面消息中的DispatcherServlet/DispatcherPortlet 有点惊讶,因为我没有在这个应用程序中使用 portlet。

另外,当我启动应用程序时,我会看到很多类似以下的日志消息,这些消息在 Windows 下运行时不会出现:

DEBUG resource.ResourceTagLib - Resource: /images/tab_l.png - disposition image - rendering disposition defer
DEBUG resource.ResourceTagLib - Resource: /images/tab_r.png - disposition image - rendering disposition defer
DEBUG resource.ResourceTagLib - Resource: /images/tab_m.png - disposition image - rendering disposition defer

【问题讨论】:

  • 消息提到 DispatcherServlet/DispatcherPortlet 只是因为显然这个问题在这两种情况下都会出现。使用 grails,您确实在后台使用 DispatcherServlet,因此您可以忽略 DispatcherPortlet 的提及

标签: grails ubuntu groovy


【解决方案1】:

我认为你正面临这个错误:http://jira.grails.org/browse/GPRESOURCES-111。这是默认安装在 grails 2 应用程序中的资源插件的一个错误。问题出在 web.xml 中——“grailsWebRequest”过滤器映射应该在列表的第一位。详情请查看错误描述。

有两种方法可以解决此错误 - 卸载资源插件或手动编辑已部署应用程序上的 web.xml 并将“grailsWebRequest”过滤器映射移动为第一个。

我不知道处置图像评论有什么问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-23
    相关资源
    最近更新 更多