本文主要是介绍记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个无参构造函数解决了该问题。
这篇关于记1次OpenFeign请求偶发解析失败问题的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!