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
...全文
2019 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
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
  • 打赏
  • 举报
回复

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧