Json转对象失败

com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of com.huasisoft.egAffairs.JsonResult: no suitable constructor found, can not deserialize from Object value

没有无参构造函数,再json转换的时候bean类要加上无参构造函数,如JsonResult
Json转对象失败:"No suitable constructor found for type [simple type, class com.test.faster.domain.respons
今天自己定制一个json转换对象的方法,转换过程中报错:

"No suitable constructor found for type [simple type, class com.test.faster.domain.response.User]: can not instantiate from JSON object (need to add/enable type information?)

原因java bean中没有提供无参的构造函数,在bean中构造一个方法就可以了

你可能感兴趣的:(Java,Json,解析)