`
zeeeitch
  • 浏览: 83599 次
  • 性别: Icon_minigender_1
  • 来自: 九江
社区版块
存档分类
最新评论

grails1.1 bug

    博客分类:
  • java
阅读更多
用grails1.1 开发过项目,部署在tomcat6没有问题。但是最近开发的同样版本的项目,加入了cas单点登陆,就出现了context无法启动的错误,报grailsWebRequest无法识别。看来是grails1.1 bug

后来将grailsWebRequest的定义和mapping放在了最前面,ok了。

以下是国外网友发表的,对我提示很大。

===============================================
Hello,

i have a problem deploying a war in tomcat-6.0.14 with grails-1.0 using java jdk1.5.0_12 or jdk1.6.0_03.

java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
.....Caused by: java.lang.IllegalArgumentException: Filter mapping specifies an unknown filter name grailsWebRequest
        at org.apache.catalina.core.StandardContext.addFilterMap(StandardContext.java:2157)
        ... 44 more
30.01.2008 23:52:18 org.apache.catalina.startup.ContextConfig applicationWebConfig
SCHWERWIEGEND: Parse error in application web.xml file at jndi:/localhost/timesafe-0.1/WEB-INF/web.xml
java.lang.IllegalArgumentException: Filter mapping specifies an unknown filter name grailsWebRequest
what can i do ?

Just checked out the final 1.0 version and got the same problem here.... I did some investigations and found out
that when move the
<filter-mapping>
        <filter-name>grailsWebRequest</filter-name>
        <url-pattern>/*</url-pattern>
</filter-mapping>  and the
<filter-mapping>
                <filter-name>reloadFilter</filter-name>
                <url-pattern>/*</url-pattern>
</filter-mapping> in web.xml to a position after the filter was defiend .e.g
<filter>
<filter-name>grailsWebRequest</filter-name>
                <filter-class>
                        org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter
                </filter-class>
</filter>

than the server starts up fine without any errors.  
But when i try to access my app i get a java.lang.IllegalStateException :

SCHWERWIEGEND: Servlet.service() for servlet gsp threw exception
java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request? 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:102)

what may be the problem for this ?  running the app inside intelliJ or from command line works fine ...
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics