=执行{+com.j.serviceimpl.ArticleServiceimpl+}类的的+97+行的+selectAllByIdS+()方法,
===异常信息为:{} There is a cycle in the hierarchy!
net.sf.json.JSONException: There is a cycle in the hierarchy!
at net.sf.json.util.CycleDetectionStrategy$StrictCycleDetectionStrategy.handleRepeatedReferenceAsObject(CycleDetectionStrategy.java:97)
at net.sf.json.JSONObject._fromBean(JSONObject.java:833)
原因是:在级联查询时json转换级联对象,,自关联然后死循环报错
解决办法:
JsonConfig jsonConfig = new JsonConfig();
jsonConfig.setCycleDetectionStrategy(CycleDetectionStrategy.LENIENT);
Articl articln=super.baseDaoImpl.selectAllByIdD(Articl.class.getName(), idInteger);
JSONObject json =JSONObject.fromObject(articlebean, jsonConfig);
String result = json.toString();