There is a cycle in the hierarchy解决办法
来源:互联网 发布:nginx pagespeed 配置 编辑:程序博客网 时间:2024/05/17 04:34
There is a cycle in the hierarchy解决办法:
错误原因:将对象转换为json串时的错误,可能原因是存在级联(及树结构)或者对象间的互相调用。
解决方法:去掉级联或者互相调用而导致干扰的对象,例如:
public void sendUser(User user) { JsonConfig jsonConfig = new JsonConfig(); //建立配置文件 jsonConfig.setExcludes(new String[]{"company","role","office","roleList","vacation","moreWorkTime"}); //此处是亮点,只要将所需忽略字段加到数组中即可 jsonConfig.setIgnoreDefaultExcludes(false); //设置默认忽略 jsonConfig.setCycleDetectionStrategy(CycleDetectionStrategy.LENIENT); JSONObject json = JSONObject.fromObject(user,jsonConfig); String jsonString = json.toString();}
阅读全文
1 0
- There is a cycle in the hierarchy解决办法
- There is a cycle in the hierarchy解决办法
- There is a cycle in the hierarchy
- There is a cycle in the hierarchy !!!
- There is a cycle in the hierarchy
- There is a cycle in the hierarchy
- There is a cycle in the hierarchy!
- json-lib出现There is a cycle in the hierarchy解决办法
- json-lib出现There is a cycle in the hierarchy解决办法
- json-lib出现There is a cycle in the hierarchy解决办法
- 关于json-lib There is a cycle in the hierarchy!问题的3种解决办法
- Json转换成字符串,There is a cycle in the hierarchy解决办法
- 使用JSONObject转换json数据报错:There is a cycle in the hierarchy!的解决办法
- 黑马bos项目运行json时出现There is a cycle in the hierarchy!的解决办法
- json-lib There is a cycle in the hierarchy!
- JSON There is a cycle in the hierarchy异常
- 出现“There is a cycle in the hierarchy”异常
- There is a cycle in the hierarchy原因
- Three.js 蒙皮动画源码分析图(留坑)
- 面向对象思想
- "Do Deep Nets Really Need to be Deep?"阅读笔记
- 2.3.6--Count the Trees
- bzoj 4011: [HNOI2015]落忆枫音 拓扑序dp+容斥原理
- There is a cycle in the hierarchy解决办法
- bzoj3529 [ SDOI2014 ] -- 莫比乌斯反演+分块
- Keepalived(一)在CentOS7下安装和运行Keepalived
- 索引指示器实现方法(含参属性)
- linux进程管理与调度
- 我的Java第三课
- 网络加载图片
- STL中vector的用法
- 网址信息查询