renderJson(pageMap)时报错了,很奇怪,请问是怎么回事呢

三月 21, 2020 4:56:19 下午 com.jfinal.core.ActionHandler error

严重: online_examination_jfinal.controller.TeacherController.queryExamByPage() : /teacher/queryExamByPage?limit=10&offset=0&_=1584780977317

java.lang.RuntimeException

at com.jfinal.json.JFinalJson.beanToJson(JFinalJson.java:316)

at com.jfinal.json.JFinalJson.otherToJson(JFinalJson.java:298)

at com.jfinal.json.JFinalJson.toJson(JFinalJson.java:257)

at com.jfinal.json.JFinalJson.iteratorToJson(JFinalJson.java:141)

at com.jfinal.json.JFinalJson.toJson(JFinalJson.java:250)

at com.jfinal.json.JFinalJson.toKeyValue(JFinalJson.java:122)

at com.jfinal.json.JFinalJson.mapToJson(JFinalJson.java:108)

at com.jfinal.json.JFinalJson.toJson(JFinalJson.java:254)

at com.jfinal.json.JFinalJson.toJson(JFinalJson.java:203)

at com.jfinal.kit.JsonKit.toJson(JsonKit.java:28)

at com.jfinal.render.JsonRender.<init>(JsonRender.java:125)

at com.jfinal.render.RenderFactory.getJsonRender(RenderFactory.java:103)

at com.jfinal.core.Controller.renderJson(Controller.java:1137)

at online_examination_jfinal.controller.TeacherController.queryExamByPage(TeacherController.java:295)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at com.jfinal.aop.Invocation.invoke(Invocation.java:97)

at online_examination_jfinal.interceptor.LoginInterceptor.intercept(LoginInterceptor.java:28)

at com.jfinal.aop.Invocation.invoke(Invocation.java:91)

at com.jfinal.core.ActionHandler.handle(ActionHandler.java:89)

at com.jfinal.ext.handler.ContextPathHandler.handle(ContextPathHandler.java:48)

at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:90)

at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)

at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)

at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)

at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)

at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132)

at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)

at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)

at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)

at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)

at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)

at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)

at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

at io.undertow.servlet.handlers.SessionRestoringHandler.handleRequest(SessionRestoringHandler.java:119)

at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:269)

at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:78)

at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:133)

at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:130)

at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)

at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)

at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:249)

at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:78)

at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:99)

at io.undertow.server.Connectors.executeRootHandler(Connectors.java:376)

at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at java.lang.Thread.run(Thread.java:748)

Caused by: java.lang.reflect.InvocationTargetException

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at com.jfinal.json.JFinalJson.beanToJson(JFinalJson.java:313)

... 55 more

Caused by: java.lang.NullPointerException

at org.activiti.engine.impl.persistence.entity.ExecutionEntity.ensureExecutionsInitialized(ExecutionEntity.java:701)

at org.activiti.engine.impl.persistence.entity.ExecutionEntity.getExecutions(ExecutionEntity.java:692)

... 60 more


评论区

Code_Cat

2020-03-22 12:27

已经解决!原来是因为对象不是标准的实体类,不能变成json对象

热门反馈

扫码入社