jfinal开发项目,在本地不报错的,但在服务器上点击分页查询的时候当时不会报错,过段时间系统会报错,错误信息如下:
com.jfinal.core.ActionException
at com.jfinal.core.Controller.renderError(Controller.java:1210)
at com.jfinal.club._admin.auth.AdminAuthInterceptor.intercept(AdminAuthInterceptor.java:55)
at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
at com.jfinal.club.common.interceptor.ExceptionInterceptor.intercept(ExceptionInterceptor.java:11)
at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
at com.jfinal.club.common.interceptor.LoginSessionInterceptor.intercept(LoginSessionInterceptor.java:55)
at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
at com.jfinal.core.ActionHandler.handle(ActionHandler.java:78)
at com.jfinal.club.common.handler.UrlSeoHandler.handle(UrlSeoHandler.java:78)
at com.jfinal.plugin.druid.DruidStatViewHandler.handle(DruidStatViewHandler.java:81)
at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
JFinal-3.4 action report -------- 2019-09-16 15:07:54 --------------------------
Url : GET /admin/complaintMessage
Controller : com.jfinal.club._admin.complaintMessage.ComplaintMessageController.(ComplaintMessageController.java:1)
Method : index
Interceptor : com.jfinal.club.common.interceptor.LoginSessionInterceptor.(LoginSessionInterceptor.java:1)
com.jfinal.club.common.interceptor.ExceptionInterceptor.(ExceptionInterceptor.java:1)
com.jfinal.club._admin.auth.AdminAuthInterceptor.(AdminAuthInterceptor.java:1)
com.jfinal.club._admin.common.PjaxInterceptor.(PjaxInterceptor.java:1)
Parameter : p=21 cityName=?????? provinceCode=1018000000 _pjax=
--------------------------------------------------------------------------------
Sql: select accountId from account_role
where accountId = ? and roleId = 1
2019-09-16 15:07:54
[ERROR]-[Thread: http-nio-9080-exec-1]-[com.jfinal.core.ActionHandler.handle()]: /admin/complaintMessage?p=21&cityName=??????&provinceCode=1018000000&_pjax=
com.jfinal.template.TemplateException: "loginAccount" can not be null for accessed by "loginAccount.nickName"
Template: "/_view/_admin/common/_header_right.html". Line: 7
at com.jfinal.template.expr.ast.Field.eval(Field.java:66)
at com.jfinal.template.stat.ast.Output.exec(Output.java:49)
at com.jfinal.template.stat.ast.StatList.exec(StatList.java:68)
at com.jfinal.template.stat.ast.Include.exec(Include.java:139)
at com.jfinal.template.stat.ast.StatList.exec(StatList.java:68)
at com.jfinal.template.stat.ast.Define.call(Define.java:105)
at com.jfinal.template.stat.ast.Call.exec(Call.java:49)
at com.jfinal.template.stat.ast.StatList.exec(StatList.java:68)
at com.jfinal.template.stat.ast.Define.call(Define.java:105)
at com.jfinal.template.stat.ast.Call.exec(Call.java:49)
at com.jfinal.template.stat.ast.Else.exec(Else.java:35)
at com.jfinal.template.stat.ast.If.exec(If.java:56)
at com.jfinal.template.stat.ast.Define.call(Define.java:105)
at com.jfinal.template.stat.ast.Call.exec(Call.java:49)
at com.jfinal.template.stat.ast.StatList.exec(StatList.java:68)
at com.jfinal.template.Template.render(Template.java:59)
at com.jfinal.render.TemplateRender.render(TemplateRender.java:61)
at com.jfinal.core.ActionHandler.handle(ActionHandler.java:103)
at com.jfinal.club.common.handler.UrlSeoHandler.handle(UrlSeoHandler.java:78)
at com.jfinal.plugin.druid.DruidStatViewHandler.handle(DruidStatViewHandler.java:81)
at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
2019-09-16 15:07:54
[ERROR]-[Thread: http-nio-9080-exec-1]-[com.jfinal.core.JFinalFilter.doFilter()]: /admin/complaintMessage?p=21&cityName=??????&provinceCode=1018000000&_pjax=
java.lang.IllegalStateException: getOutputStream() has already been called for this response
at org.apache.catalina.connector.Response.getWriter(Response.java:583)
at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:211)
at com.jfinal.render.ErrorRender.render(ErrorRender.java:59)
at com.jfinal.core.ActionHandler.handle(ActionHandler.java:141)
at com.jfinal.club.common.handler.UrlSeoHandler.handle(UrlSeoHandler.java:78)
at com.jfinal.plugin.druid.DruidStatViewHandler.handle(DruidStatViewHandler.java:81)
at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
找了好久也找不到问题,请大佬帮忙分析一下!拜托
com.jfinal.template.TemplateException: "loginAccount" can not be null for accessed by "loginAccount.nickName"
Template: "/_view/_admin/common/_header_right.html". Line: 7
也就是说 loginAccount 这个对象为 null , 所以你的 _header_right.html 中的 #(loginAccount.nickName) 必然会有异常
loginAccount 这个对象一般是在拦截器中设定的,如果没有登录成功,那么这个对象为 null,所以需要改成:
#(loginAccount.nickName ??)
注意最后面的双问号,不添加这个双问号,在 loginAccount 为 null 时就一定会抛出异常