fastjson的坑 com.alibaba.fastjson.JSONObject cannot be cast to xxx

解析json对象时,使用了new TypeReference()对象
fastjson会对解析的对象类型进行缓存
 
new TypeReference<ResultData>(){}  使用这种方式后,会导致下面的json对象解析失败,返回jsonObject类型
new TypeReference<ResultData<ItemTO>>(){}
解决方法:对于没有返回值的对象,使用ResultData<Void>,不直接使用ResultData
 
 
原文地址:https://www.cnblogs.com/yissheng/p/5627695.html