grails1.1 bug

用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 ...
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值