【FeignClient报错】Cannot deserialize value of type``from Object value (token `JsonToken.START_OBJECT`)
1. 问题描述
@FeignClient(name = "dataServiceQueryInterface", url = "${url}:${port}")
public interface DataServiceQueryInterface {@GetMapping("/dataReport/getSysAreaAllList")List<SysArea> getSysAreaAllList() throws Exception;
}
使用接口获取数据时报错:
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception
[Request processing failed; nested exception is feign.codec.DecodeException:
Error while extracting response for type
[java.util.List<com.xxx.datamatch.datacar.entity.SysArea>] and content type
[application/json;charset=UTF-8]; nested exception is
org.springframework.http.converter.HttpMessageNotReadableException:
JSON parse error: Cannot deserialize value of type
`java.util.ArrayList<com.xxx.datamatch.datacar.entity.SysArea>`
from Object value (token `JsonToken.START_OBJECT`);
nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException:
Cannot deserialize value of type
`java.util.ArrayList<com.xxx.datamatch.datacar.entity.SysArea>`
from Object value (token `JsonToken.START_OBJECT`)
2. 问题方法
试验 1 添加依赖【无任何效果】
<dependency><groupId>com.alibaba</groupId><artifactId>fastjson</artifactId><version>1.2.46</version>
</dependency>
试验 2 修改返回类型【不报错 但是结果数据是字符串 未封装需要自行解析】
@FeignClient(name = "dataServiceQueryInterface", url = "${url}:${port}")
public interface DataServiceQueryInterface {@GetMapping("/dataReport/getSysAreaAllList")String getSysAreaAllList() throws Exception;
}
最终解决方案 3【将@GetMapping修改为@PostMapping】
@FeignClient(name = "dataServiceQueryInterface", url = "${url}:${port}")
public interface DataServiceQueryInterface {@PostMapping("/dataReport/getSysAreaAllList")List<SysArea> getSysAreaAllList() throws Exception;
}
原因没有进行深入探究,有知道原因的小伙伴可以分享一下~
【FeignClient报错】Cannot deserialize value of type``from Object value (token `JsonToken.START_OBJECT`)相关推荐
- FeignClient【问题 】Cannot deserialize value of type``from Object value (token `JsonToken.START_OBJECT`)
1. 问题描述 @FeignClient(name = "dataServiceQueryInterface", url = "${url}:${port}") ...
- 安装 sklearn 报错 ImportError: cannot import name Type
1. 安装 sklearn sudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple sklearn 会默认安装 joblib , s ...
- SAP SD VL02N对STO的交货单执行PGI,报错 -Fld selectn for mvmt type 643 acct 400020 differs for Business Area –
SAP SD VL02N对STO的交货单执行PGI,报错 -Fld selectn for mvmt type 643 acct 400020 differs for Business Area – ...
- SAP VLPOD 报错 - Update control of movement type is incorrect (entry 107 X X E B _ E) - 之对策
SAP VLPOD 报错 - Update control of movement type is incorrect (entry 107 X X E B _ E) - 之对策 如下的DN 8002 ...
- SAP WM 自动创建TO单的JOB运行报错 - Enter the storage unit type - 对策
SAP WM 自动创建TO单的JOB运行报错 - Enter the storage unit type - 对策 报错如下: 详细信息: Log for automatic creation of ...
- mybatis项目启动报错 The content of element type resultMap must match (constructor?,id*,result*,associat...
启动项目报错 2018-02-26 17:09:51,535 ERROR [org.springframework.web.context.ContextLoader] - Context initi ...
- Vue项目 报错TypeError [ERR INVALID ARG TYPE]: The “path“ argument must be of type string
# Vue项目 报错TypeError [ERR INVALID ARG TYPE]: The "path" argument must be of type string 卡了半 ...
- JS报错:Cannot read property 'type' of undefined
在做图片上传功能的时候,遇到了JS无法识别图片type的问题,在使用过程中是没有问题的,但是不知道为什么浏览器的Console报这个错误: Uncaught TypeError: Cannot rea ...
- 关于编译报错“dereferencing pointer to incomplete type...
FORM:https://my.oschina.net/michaelyuanyuan/blog/68203 今天同事问了我一个问题,他make的时候报错,"第201行:dereferenc ...
- 数据库数据修改报错The instance of entity type ‘XXX‘ cannot be tracked
在数据库更新时, 1 首先查找数据库是否包含该项 2 然后更新该项目获添加, 在先查找的时候已经跟踪数据 第二步插入会报错The instance of entity type 'XXX' canno ...
最新文章
- 我的世界服务器菜单制作,小白腐竹福[服务器菜单制作]极其详细!看了就会
- Linux之Server环境配置
- 将文件拖到docker容器里,将docke 容器里文件拖到宿主里
- 关于Time.deltatTime的理解
- (转)MFC消息机制
- linux下R及Rstudio及Rhadoop安装
- 基于 电子海图的海上搜救的研究
- 爬虫入门(1)--糗百
- theano java_Theano:调用Theano函数的论据
- 中国银行风险内控与“三道防线”
- 微博爬虫及舆情分析-3.文本清理与制作词云
- 麒麟系统云打印安装指导
- 【后端检测-绕过】文件头检测绕过、二次渲染绕过
- 鲁大师电动车智能化测评报告第八期
- 「Premiere教程」为视频添加文字字幕
- “有一只鸟来到这个世界,它该做什么?”你知道么?
- IE出现“XMLHttpRequest: 网络错误 0x80070005, 拒绝访问”的解决方案
- Android:MTK的Dialer模块联系人搜索
- ADT OO OB 的区别
- aps高级排产软件,我看行
热门文章
- dnf mysql密码多少_CentOS7 使用 dnf 安装 mysql
- 高斯牛顿迭代法的原理及实现(经典例子,附C和C++代码,含运行结果)
- 虚拟打印机 android版,虚拟打印机(ImagePrinter)
- matlab曲线拟合预判,matlab里曲线方程的拟合度,通过rms值来判断
- 软件测试面试题整理(一)之自动化测试题大合集
- 通讯录_通讯录拦截防爆
- 谁能教教我, 这个插件是怎么破解 yunfile, yifile, ctfile, 77file 等网盘的
- jedate时间插件
- jQuery 之 niceScroll
- 最新Java面试题,常见面试题及答案汇总