在项目改造SpringCloud的时候,业务端调用服务端的时候,报JSON parse error的错。
feign.codec.DecodeException: JSON parse error: Can not construct instance of com.example.model.PageResult:
no suitable constructor found, can not deserialize from Object value (missing default constructor or creator, or perhaps need to add/enable type information?);
nested exception is com.fasterxml.jackson.databind.JsonMappingException:
Can not construct instance of com.example.model.PageResult: no suitable constructor found,
can not deserialize from Object value (missing default constructor or creator, or perhaps need to add/enable type information?)
at [Source: java.io.PushbackInputStream@3f8f1df2; line: 1, column: 52] (through reference chain: com.example.model.HttpResult["data"])
后来找到原因,是因为我的PageResult存在有参构造器却没有无参构造器。
public class PageResult<T> {
private int total = 0;
private List&l