NutzCN Logo
问答 org.nutz.lang.eject.EjectByGetter.eject(EjectByGetter.java:42) - Fail to value by getter
发布于 2446天前 作者 liumaobudao 2239 次浏览 复制 上一个帖子 下一个帖子
标签:

activiti TASK 里面没有 get方法
然后报错


[INFO ] 2018-03-26 16:03:16,383 org.nutz.lang.eject.EjectByGetter.eject(EjectByGetter.java:42) - Fail to value by getter java.lang.NullPointerException at org.activiti.engine.impl.persistence.entity.TaskEntity.getExecution(TaskEntity.java:323) at org.activiti.engine.impl.persistence.entity.TaskEntity$FM$getExecution$9f294669bb584e938c00a70fe1992b26.invoke(TaskEntity.java) at org.nutz.lang.eject.EjectByGetter.eject(EjectByGetter.java:33) at org.nutz.json.entity.JsonEntityField.getValue(JsonEntityField.java:173) at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:278) at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:161) at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:199) at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:350) at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:343) at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:161) at org.nutz.json.impl.JsonRenderImpl.coll2Json(JsonRenderImpl.java:440) at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:153) at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:199) at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:350) at org.nutz.json.impl.JsonRenderImpl.map2Json(JsonRenderImpl.java:252) at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:149) at org.nutz.json.Json.toJson(Json.java:239) at org.nutz.mvc.Mvcs.write(Mvcs.java:292)
[WARN ] 2018-03-26 16:03:16,386 org.nutz.mvc.impl.processor.FailProcessor.process(FailProcessor.java:28) - Error@/platform/wf/cfg/task/tododata :
java.lang.RuntimeException: Fail to invoke getter org.activiti.engine.impl.persistence.entity.TaskEntity.'getExecution()' <class org.activiti.engine.impl.persistence.entity.TaskEntity> because [java.lang.NullPointerException]: null
	at org.nutz.lang.Lang.makeThrow(Lang.java:133)
	at org.nutz.lang.eject.EjectByGetter.eject(EjectByGetter.java:43)
	at org.nutz.json.entity.JsonEntityField.getValue(JsonEntityField.java:173)
	at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:278)
	at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:161)
	at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:199)
	at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:350)
	at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:343)
	at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:161)
	at org.nutz.json.impl.JsonRenderImpl.coll2Json(JsonRenderImpl.java:440)
	at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:153)
	at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:199)
	at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:350)
	at org.nutz.json.impl.JsonRenderImpl.map2Json(JsonRenderImpl.java:252)
	at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:149)
	at org.nutz.json.Json.toJson(Json.java:239)
	at org.nutz.mvc.Mvcs.write(Mvcs.java:292)

代码

        TaskQuery todoTaskQuery = taskService.createTaskQuery().taskAssignee(user.getLoginname()).active()
                .includeProcessVariables().orderByTaskCreateTime().desc();
17 回复

忽略掉execution属性试试

@Ok("json:{ignore:'execution'}")

@wendal

   @At("/tododata")
    @Ok("json:{ignore:'execution'}")
    @RequiresPermissions("wf.cfg.task")

还是报错 同样的

贴当前的报错信息

[DEBUG] 2018-03-26 16:54:19,376 org.apache.ibatis.transaction.jdbc.JdbcTransaction.close(JdbcTransaction.java:92) - Closing JDBC Connection [com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl@730e633]
[DEBUG] 2018-03-26 16:54:19,377 org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:40) - --- TaskQueryImpl finished --------------------------------------------------------
[DEBUG] 2018-03-26 16:54:19,377 org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:41) - 

[INFO ] 2018-03-26 16:54:19,377 org.nutz.lang.eject.EjectByGetter.eject(EjectByGetter.java:42) - Fail to value by getter
java.lang.NullPointerException
	at org.activiti.engine.impl.persistence.entity.TaskEntity.getExecution(TaskEntity.java:323)
	at org.activiti.engine.impl.persistence.entity.TaskEntity$FM$getExecution$9f294669bb584e938c00a70fe1992b26.invoke(TaskEntity.java)
	at org.nutz.lang.eject.EjectByGetter.eject(EjectByGetter.java:33)
	at org.nutz.json.entity.JsonEntityField.getValue(JsonEntityField.java:173)
	at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:278)
	at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:161)
	at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:199)
	at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:350)
	at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:343)
	at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:161)
	at org.nutz.json.impl.JsonRenderImpl.coll2Json(JsonRenderImpl.java:440)
	at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:153)
	at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:199)
	at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:350)
	at org.nutz.json.impl.JsonRenderImpl.map2Json(JsonRenderImpl.java:252)
	at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:149)
	at org.nutz.json.Json.toJson(Json.java:239)
	at org.nutz.mvc.Mvcs.write(Mvcs.java:292)
	at org.nutz.mvc.view.UTF8JsonView.render(UTF8JsonView.java:68)
	at org.nutz.mvc.impl.processor.ViewProcessor.process(ViewProcessor.java:66)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:33)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:30)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at cn.wizzer.app.web.commons.processor.XssSqlFilterProcessor.process(XssSqlFilterProcessor.java:35)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at cn.wizzer.app.web.commons.processor.NutShiroProcessor.process(NutShiroProcessor.java:52)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at cn.wizzer.app.web.commons.processor.GlobalsSettingProcessor.process(GlobalsSettingProcessor.java:41)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at cn.wizzer.app.web.commons.processor.LogTimeProcessor.process(LogTimeProcessor.java:21)
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:202)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
	at cn.wizzer.app.web.commons.filter.RouteFilter.doFilter(RouteFilter.java:31)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
	at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
	at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
	at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
	at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2521)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2510)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)
[DEBUG] 2018-03-26 16:54:19,379 cn.wizzer.app.web.commons.processor.LogTimeProcessor.process(LogTimeProcessor.java:26) - [GET ]URI=/platform/wf/cfg/task/tododata 72ms
[WARN ] 2018-03-26 16:54:19,379 org.nutz.mvc.impl.processor.FailProcessor.process(FailProcessor.java:28) - Error@/platform/wf/cfg/task/tododata :
java.lang.RuntimeException: Fail to invoke getter org.activiti.engine.impl.persistence.entity.TaskEntity.'getExecution()' <class org.activiti.engine.impl.persistence.entity.TaskEntity> because [java.lang.NullPointerException]: null
	at org.nutz.lang.Lang.makeThrow(Lang.java:133)
	at org.nutz.lang.eject.EjectByGetter.eject(EjectByGetter.java:43)
	at org.nutz.json.entity.JsonEntityField.getValue(JsonEntityField.java:173)
	at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:278)
	at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:161)
	at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:199)
	at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:350)
	at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:343)
	at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:161)
	at org.nutz.json.impl.JsonRenderImpl.coll2Json(JsonRenderImpl.java:440)
	at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:153)
	at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:199)
	at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:350)
	at org.nutz.json.impl.JsonRenderImpl.map2Json(JsonRenderImpl.java:252)
	at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:149)
	at org.nutz.json.Json.toJson(Json.java:239)
	at org.nutz.mvc.Mvcs.write(Mvcs.java:292)
	at org.nutz.mvc.view.UTF8JsonView.render(UTF8JsonView.java:68)
	at org.nutz.mvc.impl.processor.ViewProcessor.process(ViewProcessor.java:66)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:33)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:30)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at cn.wizzer.app.web.commons.processor.XssSqlFilterProcessor.process(XssSqlFilterProcessor.java:35)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at cn.wizzer.app.web.commons.processor.NutShiroProcessor.process(NutShiroProcessor.java:52)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at cn.wizzer.app.web.commons.processor.GlobalsSettingProcessor.process(GlobalsSettingProcessor.java:41)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at cn.wizzer.app.web.commons.processor.LogTimeProcessor.process(LogTimeProcessor.java:21)
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:202)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
	at cn.wizzer.app.web.commons.filter.RouteFilter.doFilter(RouteFilter.java:31)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
	at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
	at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
	at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
	at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2521)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2510)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)
[DEBUG] 2018-03-26 16:54:37,876 org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.manage(JobStoreSupport.java:3877) - ClusterManager: Check-in complete.

sorry, 给错了...

@Ok("json:{locked:'execution'}")

@wendal
还是报错。。。

    @At("/tododata")
    @Ok("json:{locked:'execution'}")
    @RequiresPermissions("wf.cfg.task")
[DEBUG] 2018-03-26 17:06:08,671 org.activiti.engine.impl.cfg.standalone.StandaloneMybatisTransactionContext.commit(StandaloneMybatisTransactionContext.java:68) - firing event committed...
[DEBUG] 2018-03-26 17:06:08,671 org.apache.ibatis.transaction.jdbc.JdbcTransaction.resetAutoCommit(JdbcTransaction.java:124) - Resetting autocommit to true on JDBC Connection [com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl@9d1d0eb]
[DEBUG] 2018-03-26 17:06:08,671 org.apache.ibatis.transaction.jdbc.JdbcTransaction.close(JdbcTransaction.java:92) - Closing JDBC Connection [com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl@9d1d0eb]
[DEBUG] 2018-03-26 17:06:08,672 org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:40) - --- TaskQueryImpl finished --------------------------------------------------------
[DEBUG] 2018-03-26 17:06:08,672 org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:41) - 

[INFO ] 2018-03-26 17:06:08,673 org.nutz.lang.eject.EjectByGetter.eject(EjectByGetter.java:42) - Fail to value by getter
java.lang.NullPointerException
	at org.activiti.engine.impl.persistence.entity.TaskEntity.getExecution(TaskEntity.java:323)
	at org.activiti.engine.impl.persistence.entity.TaskEntity$FM$getExecution$9f294669bb584e938c00a70fe1992b26.invoke(TaskEntity.java)
	at org.nutz.lang.eject.EjectByGetter.eject(EjectByGetter.java:33)
	at org.nutz.json.entity.JsonEntityField.getValue(JsonEntityField.java:173)
	at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:278)
	at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:161)
	at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:199)
	at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:350)
	at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:343)
	at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:161)
	at org.nutz.json.impl.JsonRenderImpl.coll2Json(JsonRenderImpl.java:440)
	at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:153)
	at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:199)
	at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:350)
	at org.nutz.json.impl.JsonRenderImpl.map2Json(JsonRenderImpl.java:252)
	at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:149)
	at org.nutz.json.Json.toJson(Json.java:239)
	at org.nutz.mvc.Mvcs.write(Mvcs.java:292)
	at org.nutz.mvc.view.UTF8JsonView.render(UTF8JsonView.java:68)
	at org.nutz.mvc.impl.processor.ViewProcessor.process(ViewProcessor.java:66)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:33)

[WARN ] 2018-03-26 17:06:08,683 org.nutz.mvc.impl.processor.FailProcessor.process(FailProcessor.java:28) - Error@/platform/wf/cfg/task/tododata :
java.lang.RuntimeException: Fail to invoke getter org.activiti.engine.impl.persistence.entity.TaskEntity.'getExecution()' <class org.activiti.engine.impl.persistence.entity.TaskEntity> because [java.lang.NullPointerException]: null
	at org.nutz.lang.Lang.makeThrow(Lang.java:133)
	at org.nutz.lang.eject.EjectByGetter.eject(EjectByGetter.java:43)
	at org.nutz.json.entity.JsonEntityField.getValue(JsonEntityField.java:173)
	at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:278)
	at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:161)
	at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:199)
	at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:350)
	at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:343)
	at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:161)
	at org.nutz.json.impl.JsonRenderImpl.coll2Json(JsonRenderImpl.java:440)
	at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:153)
	at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:199)
	at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:350)
	at org.nutz.json.impl.JsonRenderImpl.map2Json(JsonRenderImpl.java:252)
	at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:149)
	at org.nutz.json.Json.toJson(Json.java:239)

奇怪,为啥还是调用了呢

在Setup的init方法里面加入这些代码试试

        JsonEntity en = Json.getEntity(Mirror.me(TaskEntity.class));
        en.getFieldMap().remove("execution");
        en.getFields().remove(en.getField("execution"));

@wendal 还是报哪个错误

还是getExecution方法?

确认一下那段代码执行了

@wendal 确认执行了 群里有截图 class 文件

发现 和 execution 有关的 ProcessInstanceQuery TaskQuery 查询的时候 都会报错

神奇了,难道不是TaskEntity而是它的子类?debug一下getExecution方法,看看对象的类是什么

@wendal


public ExecutionEntity getExecution() { if ( (execution==null) && (executionId!=null) ) { this.execution = Context .getCommandContext() .getExecutionEntityManager()//这里报的空 .findExecutionById(executionId); } return execution; }

public class ExecutionEntity extends VariableScopeImpl implements ActivityExecution, ExecutionListenerExecution, Execution, PvmExecution, ProcessInstance, InterpretableExecution, PersistentObject, HasRevision { private static final long serialVersionUID = 1L; private static Logger log = LoggerFactory.getLogger(ExecutionEntity.class); // Persistent refrenced entities state ////////////////////////////////////// protected static final int EVENT_SUBSCRIPTIONS_STATE_BIT = 1; protected static final int TASKS_STATE_BIT = 2; protected static final int JOBS_STATE_BIT = 3; // current position ///////////////////////////////////////////////////////// protected ProcessDefinitionImpl processDefinition; /** current activity */ protected ActivityImpl activity; /** current transition. is null when there is no transition being taken. */ protected TransitionImpl transition = null; /** transition that will be taken. is null when there is no transition being taken. */ protected TransitionImpl transitionBeingTaken = null; /** the process instance. this is the root of the execution tree. * the processInstance of a process instance is a self reference. */ protected ExecutionEntity processInstance; /** the parent execution */ protected ExecutionEntity parent; /** nested executions representing scopes or concurrent paths */ protected List<ExecutionEntity> executions; /** super execution, not-null if this execution is part of a subprocess */ protected ExecutionEntity superExecution;

TaskEntry不适合直接传到前台, 走VO对象解决

添加回复
请先登陆
回到顶部