0
点赞
收藏
分享

微信扫一扫

【OpenFeign】OpenFeign问题:java.lang.NoSuchMethodError: feign.Request.requestBody()Lfeign/Request$Body;


一、参考资料

1. github地址

​​GitHub - spring-cloud/spring-cloud-openfeign: Support for using OpenFeign in Spring Cloud apps​​

1. 问题描述

21-11-23 11:33:22.941 ERROR [XNIO-1 task-1] c.e.rpc.http.GlobalExceptionHandler     :115 - Servlet exception caught: Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: feign.Request.requestBody()Lfeign/Request$Body;

2. 问题分析

​​Spring-cloud升级异常:java.lang.NoSuchMethodError: feign.Request.requestBody()Lfeign/Request$Body;_一只小码渣的博客​

​​nacos使用openfeign调用服务 - 简书​​

​​使用HttpClient和OkHttp调用服务的区别(附示例代码) - 骑着蜗牛看海呀 -


排查源码最后发现是uri=/,原来是RequestMapping的value写成了name

【OpenFeign】OpenFeign问题:java.lang.NoSuchMethodError: feign.Request.requestBody()Lfeign/Request$Body;_hibernate

原来是RequestMapping的value写成了name

@Service
@FeignClient(value = "appcore")
public interface AppCoreService {
@GetMapping(value = "/status")
String status();
}

​​@RequestMapping与@GetMapping和@PostMapping等新注释 -解道Jdon​​

最终发现问题没有指定包

@EnableFeignClients(basePackages = "com.xxx.xxx.openfeign.*")

终于解决了

// https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-openfeign-core
implementation 'org.springframework.cloud:spring-cloud-openfeign-core:2.2.10.RELEASE'

​​Feign全局异常处理 - 简书​​

【OpenFeign】OpenFeign问题:java.lang.NoSuchMethodError: feign.Request.requestBody()Lfeign/Request$Body;_centos_02

​​Spring Cloud Feign(第四篇)之Fallback_孙平平的博客-

举报

相关推荐

0 条评论