哪位给分析下下面的报错是哪里的问题呢?
下面的错误是偶发性的 也就是同样的10次url请求 可能会有1次报错
我的服务器是用apache+tomcat 通过ajp通信的
2013-08-15 18:18:08 [ERROR]-[Thread: ajp-apr-8009-exec-9]-[com.jfinal.core.ActionHandler.handle()]: /user/yaoQing?qq=1625980300&code=234015170512460 java.lang.NullPointerException at org.apache.catalina.connector.CoyoteWriter.write(CoyoteWriter.java:184) at com.jfinal.render.TextRender.render(TextRender.java:57) at com.jfinal.core.ActionHandler.handle(ActionHandler.java:94) at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:65) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:197) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1822) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) 2013-08-15 18:18:08 [ERROR]-[Thread: ajp-apr-8009-exec-9]-[com.jfinal.core.JFinalFilter.doFilter()]: /user/yaoQing?qq=1625980300&code=234015170512460 com.jfinal.render.RenderException: java.lang.IllegalStateException: Cannot forward after response has been committed at com.jfinal.render.JspRender.render(JspRender.java:58) at com.jfinal.render.Error500Render.render(Error500Render.java:46) at com.jfinal.core.ActionHandler.handle(ActionHandler.java:121) at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:65) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:197) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1822) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.IllegalStateException: Cannot forward after response has been committed at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:349) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339) at com.jfinal.render.JspRender.render(JspRender.java:56) ... 18 more
第一个空指针异常发生在 org.apache.catalina.connector.CoyoteWriter.write(CoyoteWriter.java:184),目标测与JFinal无关,建议检查一下Apache与AJP相关配置
第二个异常是 IllegalStateException:Cannotforwardafterresponsehasbeencommitted,是指在此代码之前从HttpResponse得到的Writer输出流已经被关闭如:writer.close()。调试检查一下前面在Handler、Controller、Interceptor中是否做过这样的操作
回复 @本人纯属虚构:为啥不用nginx呢?轻量、资源占用低,配置简单我也感觉和apacheajp有关系但是是偶发的也不知道如何检查下面那个也知道意思,不过没有写代码close都是直接调用的jfinal的方法在方法执行前检查了下code是否合法不过也没有close也没提示我那一行代码抛出来的错汗....第一个空指针异常发生在 org.apache.catalina.connector.CoyoteWriter.write(CoyoteWriter.java:184),目标测与JFinal无关,建议检查一下Apache与AJP相关配置
第二个异常是 IllegalStateException:Cannotforwardafterresponsehasbeencommitted,是指在此代码之前从HttpResponse得到的Writer输出流已经被关闭如:writer.close()。调试检查一下前面在Handler、Controller、Interceptor中是否做过这样的操作
第一个空指针异常发生在 org.apache.catalina.connector.CoyoteWriter.write(CoyoteWriter.java:184),目标测与JFinal无关,建议检查一下Apache与AJP相关配置
第二个异常是 IllegalStateException:Cannotforwardafterresponsehasbeencommitted,是指在此代码之前从HttpResponse得到的Writer输出流已经被关闭如:writer.close()。调试检查一下前面在Handler、Controller、Interceptor中是否做过这样的操作
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。