JSONArray 报错: NoSuchMethodException: Property 'delegate' has no getter method

前端之家收集整理的这篇文章主要介绍了JSONArray 报错: NoSuchMethodException: Property 'delegate' has no getter method前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

当我们配置完OpenSessionInViewFilter,或者把转换对象为json字串的操作放到了事务里面以后,仍然报错 :java.lang.NoSuchMethodException: Property 'delegate' has no getter method .

一种解决方案:


JsonConfig config = new JsonConfig();

config.setExcludes(new String[]{"one2many的字段集合名称","hibernateLazyInitializer","handler","tProvince"});

JSONArray jsonArray = JSONArray.fromObject(dao.getAll(rowStartIdxAndCount),config);

return jsonArray.toString();

猜你在找的Json相关文章