com.googlecode.jsonplugin.JSONException: java.lang.reflect.InvocationTargetException解决方法

来源:互联网 发布:简单的java反转字符串 编辑:程序博客网 时间:2024/05/21 21:43

原因:出现这种情况是在使用json-plugin时,一些不需要串行化的属性被序列化了 比如spring 注入的 services生成了getter、序列化ID生成了getter等等 ,json plugin会把有getter方法的属性序列化,格式化为json串 。

 

 解决办法:1、可以去掉getter或者在getter上加上@JSON(serialize=false)

                2 、去掉不需要的getter

原创粉丝点击