开发者社区> 问答> 正文

关于Jfinal的NullPointerException问题?报错


哪位给分析下下面的报错是哪里的问题呢?

下面的错误是偶发性的 也就是同样的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 

展开
收起
爱吃鱼的程序员 2020-06-22 17:26:51 599 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

      第一个空指针异常发生在 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也没提示我那一行代码抛出来的错汗....

    引用来自“JFinal”的答案

      第一个空指针异常发生在 org.apache.catalina.connector.CoyoteWriter.write(CoyoteWriter.java:184),目标测与JFinal无关,建议检查一下Apache与AJP相关配置

      第二个异常是 IllegalStateException:Cannotforwardafterresponsehasbeencommitted,是指在此代码之前从HttpResponse得到的Writer输出流已经被关闭如:writer.close()。调试检查一下前面在Handler、Controller、Interceptor中是否做过这样的操作

    引用来自“JFinal”的答案

      第一个空指针异常发生在 org.apache.catalina.connector.CoyoteWriter.write(CoyoteWriter.java:184),目标测与JFinal无关,建议检查一下Apache与AJP相关配置

      第二个异常是 IllegalStateException:Cannotforwardafterresponsehasbeencommitted,是指在此代码之前从HttpResponse得到的Writer输出流已经被关闭如:writer.close()。调试检查一下前面在Handler、Controller、Interceptor中是否做过这样的操作

    2020-06-22 17:27:06
    赞同 展开评论 打赏
问答分类:
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载