springmvc获取activiti待办的json数据时报错了

duantian2015 内蒙古科电数据服务有限公司 移动客户端工程师  2017-11-12 09:37:05
关键错误信息:

org.springframework.http.converter.HttpMessageNotWritableException: Could not write content: lazy loading outside command context

Caused by: com.fasterxml.jackson.databind.JsonMappingException: lazy loading outside command context (through reference chain

Caused by: org.activiti.engine.ActivitiException: lazy loading outside command context
...全文
817 3 1 打赏 收藏 举报
写回复
3 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
rtfscwhc009 2017-12-14
楼主解决这个问题了吗? 我这边也碰到这个问题了 在查询到group的任务通过框架返回json对象报错

11:50:55.867 [http-apr-7080-exec-6] DEBUG org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver - Resolving exception from handler [public java.lang.Object top.rtfsc8.demos.activiti.helloworld.controller.HelloWorldController.tasks(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,top.rtfsc8.demos.activiti.helloworld.pojo.request.HelloWorldStartPojo)]: org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON document: lazy loading outside command context (through reference chain: java.util.HashMap["data"]->java.util.HashMap["list"]->top.rtfsc8.demos.activiti.helloworld.utils.Page["result"]->java.util.ArrayList[0]->org.activiti.engine.impl.persistence.entity.TaskEntity["variableInstances"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: lazy loading outside command context (through reference chain: java.util.HashMap["data"]->java.util.HashMap["list"]->top.rtfsc8.demos.activiti.helloworld.utils.Page["result"]->java.util.ArrayList[0]->org.activiti.engine.impl.persistence.entity.TaskEntity["variableInstances"])
11:50:55.867 [http-apr-7080-exec-6] DEBUG org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver - Resolving exception from handler [public java.lang.Object top.rtfsc8.demos.activiti.helloworld.controller.HelloWorldController.tasks(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,top.rtfsc8.demos.activiti.helloworld.pojo.request.HelloWorldStartPojo)]: org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON document: lazy loading outside command context (through reference chain: java.util.HashMap["data"]->java.util.HashMap["list"]->top.rtfsc8.demos.activiti.helloworld.utils.Page["result"]->java.util.ArrayList[0]->org.activiti.engine.impl.persistence.entity.TaskEntity["variableInstances"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: lazy loading outside command context (through reference chain: java.util.HashMap["data"]->java.util.HashMap["list"]->top.rtfsc8.demos.activiti.helloworld.utils.Page["result"]->java.util.ArrayList[0]->org.activiti.engine.impl.persistence.entity.TaskEntity["variableInstances"])
11:50:55.868 [http-apr-7080-exec-6] DEBUG org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver - Resolving exception from handler [public java.lang.Object top.rtfsc8.demos.activiti.helloworld.controller.HelloWorldController.tasks(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,top.rtfsc8.demos.activiti.helloworld.pojo.request.HelloWorldStartPojo)]: org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON document: lazy loading outside command context (through reference chain: java.util.HashMap["data"]->java.util.HashMap["list"]->top.rtfsc8.demos.activiti.helloworld.utils.Page["result"]->java.util.ArrayList[0]->org.activiti.engine.impl.persistence.entity.TaskEntity["variableInstances"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: lazy loading outside command context (through reference chain: java.util.HashMap["data"]->java.util.HashMap["list"]->top.rtfsc8.demos.activiti.helloworld.utils.Page["result"]->java.util.ArrayList[0]->org.activiti.engine.impl.persistence.entity.TaskEntity["variableInstances"])
11:50:55.868 [http-apr-7080-exec-6] WARN  org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver - Failed to write HTTP message: org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON document: lazy loading outside command context (through reference chain: java.util.HashMap["data"]->java.util.HashMap["list"]->top.rtfsc8.demos.activiti.helloworld.utils.Page["result"]->java.util.ArrayList[0]->org.activiti.engine.impl.persistence.entity.TaskEntity["variableInstances"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: lazy loading outside command context (through reference chain: java.util.HashMap["data"]->java.util.HashMap["list"]->top.rtfsc8.demos.activiti.helloworld.utils.Page["result"]->java.util.ArrayList[0]->org.activiti.engine.impl.persistence.entity.TaskEntity["variableInstances"])
  • 打赏
  • 举报
回复
xysz13 2017-12-14
试一下这个注解
  • 打赏
  • 举报
回复
xysz13 2017-12-14
  • 打赏
  • 举报
回复
相关推荐
发帖
Web 开发
加入

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2017-11-12 09:37
社区公告
暂无公告