赞
踩
feign.codec.DecodeException: Could not extract response: no suitable HttpMessageConverter found for response type [com.common.util.Result<com.entity.User>] and content type [text/html]
1、调用接口地址与被调用接口地址不一致,导致报错。
被调用的接口:
- @RestController
- @RequestMapping("/test")
- public class TestController {
- @GetMapping("/test1")
- public Result<User> test1() {
- int i = 1 / 0;
- return Result.success("操作成功");
- }
- }
调用接口:
- @GetMapping("/test1")
- Result<User> test1();
解决办法:调用接口地址和被调用接口地址保持一致即可。
- @GetMapping("/test/test1")
- Result<User> test1();
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。