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