我正在Tomcat6中使用Spring3,JSF2和Primefaces3开发一个Web应用程序...如果我使用的是Firefox,我的应用程序就可以正常工作了。如果我也使用IE 8运行应用程序,我将获得如下所示的异常堆栈。这很奇怪,因为如果存在一些不兼容问题,我会期待一些视觉错误,而不是apache tomcat抛出的东西......
异常堆栈:
SEVERE: An exception or error occurred in the container during the request processing
java.lang.NullPointerException
at org.apache.tomcat.util.http.MimeHeaders.setValue(MimeHeaders.java:267)
at org.apache.coyote.http11.Http11Processor.prepareResponse(Http11Processor.java:1558)
at org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:956)
at org.apache.coyote.Response.action(Response.java:183)
at org.apache.coyote.Response.sendHeaders(Response.java:379)
at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:314)
at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:296)
at org.apache.catalina.connector.Response.flushBuffer(Response.java:549)
at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:272)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at com.googlecode.psiprobe.Tomcat60AgentValve.invoke(Tomcat60AgentValve.java:30)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
Nov 14, 2011 10:27:05 AM org.apache.coyote.http11.Http11Processor process
SEVERE: Error finishing response
java.lang.NullPointerException
at org.apache.tomcat.util.http.MimeHeaders.setValue(MimeHeaders.java:267)
at org.apache.coyote.http11.Http11Processor.prepareResponse(Http11Processor.java:1558)
at org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:956)
at org.apache.coyote.Response.action(Response.java:181)
at org.apache.coyote.http11.InternalOutputBuffer.endRequest(InternalOutputBuffer.java:398)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:901)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
Nov 14, 2011 10:27:05 AM org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler process
SEVERE: Error reading request, ignored
java.lang.NullPointerException
at org.apache.tomcat.util.http.MimeHeaders.clear(MimeHeaders.java:130)
at org.apache.coyote.Response.recycle(Response.java:579)
at org.apache.coyote.http11.InternalOutputBuffer.nextRequest(InternalOutputBuffer.java:368)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:923)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
和
SEVERE: Servlet.service() for servlet Faces Servlet 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 creazione.exception.MyFilter.doFilter(MyFilter.java:50)
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:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at com.googlecode.psiprobe.Tomcat60AgentValve.invoke(Tomcat60AgentValve.java:30)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
PS:我还添加了JSF,Spring和Primefaces作为标签,因为它可能是一个不兼容的问题。
编辑:
aopalliance-1.0.jar
asm-1.5.1.jar
aspectj-1.6.3.jar
aspectjrt-1.6.0.jar
aspectjweaver.jar
commons-dbcp-1.4.jar
commons-fileupload-1.2.2.jar
commons-io-2.0.1.jar
commons-net-1.4.1.jar
commons-pool-1.5.6.jar
jakarta-oro-2.0.8.jar
javax.jms.jar
jndi.jar
oracle10g.jar
SPRING 3.0.6 library
primefaces-3.0.M4.jar
hibernate-persistence library
JSF2.1.4 (but I've changed back to jsf2.1.3)
jstl 11 library
junit lib
junit_4 lib
由于我改回jsf 2.1.3,IE上的行为略有改变:有时显示页面但是按钮被冻结,有时组件被混乱地渲染,有时我得到HTTP 404错误 - 非常奇怪!< / p>
答案 0 :(得分:2)
从/WEB-INF/lib
列表中
JSF2.1.4(但我已经改回jsf2.1.3)
Mojarra 2.1 requires一个Servlet 3.0容器,但Tomcat 6.0是一个Servlet 2.5容器。您需要Mojarra 2.0(或者您需要升级到Tomcat 7.0)。虽然这仍然没有解释你所获得的例外(据我所知),我建议将其排除以排除其中一个。
对于具体的异常,它们表明您的webapp的运行时类路径与来自不同Tomcat版本的特定于Tomcat的核心库混杂在一起。 webapp的运行时类路径涵盖了Webapp/WEB-INF/lib
,Tomcat/lib
,Tomcat共享/公共,JRE/lib
和JRE/lib/ext
等。例如,如果您在其他而不是servlet-api.jar
的任何地方有jsp-api.jar
,Tomcat/lib
或其他任何内容,则应将其删除。