用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 ...
分享到:
相关推荐
Grails1.1中文文档
Grails是个一栈式开发框架,它尝试通过核心技术和插件技术来解决许多Web开发难题
grails1.1中文文档,用户指南,对于grails入门者是份不错的资料参考
Grails1.1中文文档.zip
Grails 1.1 Web Application Development.pdf
Grails1.1最新 中文 文档 当今的Java Web开发技术显得过于复杂,相对于它本身的需要来说。现在主流的Java Web框架也是异常复杂,而且没有很好的遵循 Don't Repeat Yourself (DRY) 法则。 因此我们要以一种新的思维...
Grails1.1中文文档-----2009.3.25
Grails 最新的 v1.1版的中文文档,chm格式,Grails是一套快速开发Web应用的开源框架,基于Groovy编程语言,并构建于Spring、Hibernate和其它标准Java框架之上,能为大家带来超高效率的一站式框架。
NULL 博文链接:https://nainse.iteye.com/blog/408728
grails framework 1.1 中文
grails-1.2.2.zip
Grails Quick Reference 1.1
Grails使用FCK Editor(附源码,有截图),Groovy1.5.6和Grails1.1
Apress.Beginning.Groovy.and.Grails.From.Novice.to.Professional.Jun.2008 grails_programming Grails1.1中文文档-----2009.3.25 Grails入门指南(第二版) Groovy经典入门 Programming Groovy 2 合集,超实惠哦
Grails使用FCK Editor实例(附源码和文档),groovy1.6.0和grails1.1