在用restTemplate调用其他服务接口时,接收对象是这样的,方法:
然后报异常:JSON parse error: Can not construct instance of org.springframework.data.domain.Page: abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of org.springframework.data.domain.Page: abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information\n at [Source: java.io.PushbackInputStream@7ead2a96; line: 1, column: 1],查看异常发现说的是没有办法在传输的过程中进行序列化操作,修改如下:成功。
restTemplate接口泛型类接收反序列化问题:abstract types either need to be mapped to concrete types
最新推荐文章于 2024-07-19 18:44:51 发布