JBoss5下启动正常,但访问页面出现OncePerRequestFilter just supports HTTP requests异常

fbchen 2010-09-16 04:21:58
我有一个.war包部署到JBoss5的{jboss5}/server/default/deploy目录下,启动没有出现错误,但访问JSP页面的时候出现异常,如下:
2010-09-16 16:00:57,437 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/mm].[jsp]] (http-127.0.0.1-8080-1) Servlet.service() for servlet jsp threw exception
javax.servlet.ServletException: OncePerRequestFilter just supports HTTP requests
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:62)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)

检查web.xml的配置发现有Filter如下:
<!-- Hibernate lazy config -->
<filter>
<filter-name>hibernateFilter</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>hibernateFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

跟踪发现org.springframework.web.filter.OncePerRequestFilter中的doFilter()方法抛出异常,代码如下:
if (!(request instanceof HttpServletRequest) || !(response instanceof HttpServletResponse)) {
throw new ServletException("OncePerRequestFilter just supports HTTP requests");
}

打印其实例为:
request = org.apache.catalina.connector.RequestFacade
response = org.apache.catalina.connector.ResponseFacade
...全文
604 点赞 收藏 2
写回复
2 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
fbchen 2010-09-16
解决了,删除应用的lib下的几个jar包:servlet-api.jar geronimo-servlet_2.5_spec-1.2.jar jsp-api.jar
回复
完美灬缺陷 2010-09-16
不懂...
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2010-09-16 04:21
社区公告
暂无公告