Other关于There is a cycle in the hierarchy!

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Other关于There is a cycle in the hierarchy!相关的知识,希望对你有一定的参考价值。

原因:

  父对象与子对象互相包含对方的类型的属性,造成死循环

解决方案1:

  JsonConfig config=new JsonConfig();

  config.setExcludes(new String[]{"devTask","employee","probClient"});  //传入要忽略的属性数组

  JSONObject json=JSONObject.fromObject(new Object(),config);    

 

  

  

 

  

 

以上是关于Other关于There is a cycle in the hierarchy!的主要内容,如果未能解决你的问题,请参考以下文章

net.sf.json.JSONException: There is a cycle in the hierarchy!

net.sf.json.JSONException: There is a cycle in the hierarchy!

net.sf.json.JSONException: There is a cycle in the hierarchy!错误解决方案

关于Struts2中的错误:例如There is no Action mapped for namespace / and action name product-input.

关于There is already xxx bean method报错的原因

关于使用kms时遇到的there is nothing to do here