记1次OpenFeign请求偶发解析失败问题

    记1次OpenFeign请求,遇到返回的结果无法解析的情况

feign.codec.DecodeException: Error while extracting response for type [xxxxxxx] and content type [application/json;charset=UTF-8]; nested exce
ption is org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot construct instance
of `xxxxxxxxxx` (although at least one Creator exists): cannot deserialize from Object valu
e (no delegate- or property-based Creator); nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputExcepti
on: Cannot construct instance of `com.maibao.auth.model.respone.ServerResp` (although at least one Creator exists): canno
t deserialize from Object value (no delegate- or property-based Creator)
 at [Source: (ByteArrayInputStream); line: 1, column: 2]

 开启了Feign的FULL日志,发现请求的参数,以及返回的参数和结构体,都是标准的,返回的是也是application/json,并不是其他博主上看到的text/plain,目标结构体也符合规范,但是发布版本时,有时候会出现这个报错,后将返回参数,增加了1个无参构造函数解决了该问题。

你可能感兴趣的:(Java)