net.sf.json.JSONException: There is a cycle in the hierarchy! 转json死循环问题解决
解决上述问题遵照两个原则就可以:
1、页面不需要展示关联数据时
解决:将关联对象属性排除掉
2、页面需要展示关联数据时
解决:将关联对象改为立即加载,并且将关联对象中的属性排除
net.sf.json.JSONException: There is a cycle in the hierarchy! 转json死循环问题解决的更多相关文章
- atitit.解决net.sf.json.JSONException There is a cycle in the hierarchy
		
atitit.解决net.sf.json.JSONException There is a cycle in the hierarchy 1. 环境:使用hibernate4跟个,,要不个哪的对象系列 ...
 - net.sf.json.JSONException: There is a cycle in the hierarchy!
		
因为项目中使用了AJAX技术,jar包为:json-lib.jar,在开发过程中遇到了一个JSON-LIB和Hibernate有关的问题: 如hibernate延迟加载错误,这都是些老问题了,一看就知 ...
 - net.sf.json.JSONException: There is a cycle in the hierarchy!错误解决方案
		
net.sf.json.JSONException: There is a cycle in the hierarchy!错误解决方案 今天在用List集合转换成json数组的时候发生了这个错误,这个 ...
 - net.sf.json.JSONException: There is a cycle in the hierarchy!的解决办法
		
使用Hibernate manytoone属性关联主表的时候,如果使用JSONArray把pojo对象转换成json对象时,很容易出现循环的异常.解决的办法就是, 在转换json对象时忽略manyto ...
 - json-lib-2.4-jdk15.jar 报错 net.sf.json.JSONException: There is a cycle in the hierarchy!错误解决方案(Hibernate)
		
使用hibernate容易出现该问题,主要是由于pojo类属性存在级联关系.比如说员工和部门,在员工表里面有部门属性,而在部门表里面有个员工集合,这样就存在了嵌套引用的问题了,就会抛出这个异常. 解决 ...
 - hibernate:There is a cycle in the hierarchy! 造成死循环解决办法
		
下面是报的异常:在网上搜了关于:There is a cycle in the hierarchy!,才知道原来是因为死循环造成的!解决了好久,没有成功,后台不得已请教老大,老大说是因为在使用JSON ...
 - Json_异常_net.sf.json.JSONException: JSONObject["solution"] not found.
		
net.sf.json.JSONException: JSONObject["solution"] not found. 没有这个元素造成的. 问题代码: JSONObject j ...
 - net.sf.json.JSONException: java.lang.NoSuchMethodException
		
在尝试将json对象转换为list时候出现了如下错误 Exception in thread "main" net.sf.json.JSONException: java.lang ...
 - json解析异常 - net.sf.json.JSONException: java.lang.reflect.InvocationTargetException
		
注:在项目中, 我使用原生的ajax请求数据的时候, JSONObject没能帮我解析, 当却不给我报错, 我是在junit单元测试中测试的时候, 发现的.发现好多时候, 特别是通过ajax请求, 不 ...
 
随机推荐
- tomcat启动startup.bat一闪而过
			
编辑startup.bat,在文本最后添加PAUSE,保存后打开startup.bat,此时窗口会暂停,并出现错误信息,然后按照错误提示纠正即可!
 - delphi7和XE下  获取路径
			
XE里没有Application.Exename所以用paramstr(0); Str:=ParamStr(0); //自己全路径c:\555\qq.exe,可用于控制台Str:=ExpandFile ...
 - Sharepoint2013搜索学习笔记之自定义结果显示模板(九)
			
搜索结果通过套用定义好的显示模板来展示结果,显示模板由js和html组成,我们可以通过修改显示模板,然后将修改好的显示模板跟搜索结果绑定起来,来修改搜索结果的显示效果,例子如下图: 修改前 修改后 第 ...
 - android和.net webservice中的DES加密算法
			
也是看了一堆的例子,本身并不会写加密算法,好在只要会用就行了,我们把在app中使用的参数加密,然后在.net端的webservice中进行解密,本身并没有什么问题,但是android下和.net下的d ...
 - SQLServer 统计查询语句消耗时间
			
--方法1[set statistic ]: set statistics time on go --执行语句 xxxx go set statistics time off --方法2[getDat ...
 - CHNetRequest网络请求
			
Paste JSON as Code • quicktype 软件的使用 iOS开发:官方自带的JSON使用 JSON 数据解析 XML 数据解析 Plist 数据解析 NetRequest 网络数据 ...
 - 网页控件很多时最好用绝对定位absolute
			
否则动一个位置可能影响其他的,牵一发而动全身
 - application的使用(实现计数器)
			
application在整个WEB项目中共享使用数据. 常用方法: getAttribute(); setAttribute();示列: <% Object count=applicati ...
 - sqoop常用语句
			
1,列出全部数据库 sqoop list-databases --connect jdbc:sqlserver://10.10.10.2 --username sa --password 1 2,导 ...
 - 4A - Horse
			
打表找规律 #include <iostream> #include <queue> using namespace std; ][]; ]{, , , , -, -, -, ...