今天在使用OpenFeign,Demo2模块远程调用Demo1模块时,报错。
报错内容为:
feign.codec.DecodeException: No qualifying bean of type 'org.springframework.boot.autoconfigure.http.HttpMessageConverters'
查阅大量资料说添加fastjson或手动注入HttpMessageConverters都不行。
后来自己通过debug发现,是在远程调用成功,但是在demo2中返回值的时候出错,故猜测是Http调用,反序列化时发生错误。
最后竟然发现是缺少依赖导致的
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>