2011-11-20 47 views
2

我有一個在Windows上正常工作的Grails 2.0.0.RC1應用程序。然而,當我試圖在Ubuntu下運行它,我得到以下錯誤消息時,我嘗試加載一個頁面:在Ubuntu上grails 2.0.0.RC1應用程序失敗

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 
+0

該消息提到DispatcherServlet/DispatcherPortlet只是因爲顯然這個問題可能在兩種情況下都出現。使用grails,您確實在使用DispatcherServlet,因此您可以忽略DispatcherPortlet的提及 –

回答

3

我認爲你面臨這樣的錯誤:http://jira.grails.org/browse/GPRESOURCES-111。這是缺省安裝在grails 2應用程序中的資源插件的錯誤。問題出現在web.xml中 - 「grailsWebRequest」過濾器映射應該首先在列表中。詳細檢查錯誤描述。

有兩種方法來解決此漏洞 - 手工卸載資源插件或編輯的web.xml部署上的應用和移動「grailsWebRequest」過濾器映射爲第一個。

雖然我不知道配置圖像評論有什麼問題。

相關問題