异常:
Caused by: org.codehaus.jackson.map.JsonMappingException: No suitable constructor found for type [simple type, class xxxxx]: can not instantiate from JSON object (need to add/enable type information?)
原因:
被转换json的类中,使用了带参数的构造方法,而忘记初始化原始构造方法,即,这个类没有了无参的初始化构造方法;
这种情况下,无法对该类进行实例化,没有办法进行toJson操作。
解决办法:
1.类中初始化默认构造方法;