@FeignClient注入bean找不到异常,openfeign/feign-core/10.4.0/feign-core-10.4.0.jar包冲突

该篇博客探讨了在使用Spring Boot 2.3.7.RELEASE和Spring Cloud Hoxton版本时遇到的Feign报错,涉及版本不兼容问题。作者提供了排除feign-core的解决方案,并强调了单独引入10.5.1版本的重要性,同时提醒读者检查配置中可能存在的Feign超时设置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

引用fegin报错

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    com.betterwood.common.config.feign.FeignConfigure.options(FeignConfigure.java:37)

The following method did not exist:

    feign.Request$Options.<init>(JLjava/util/concurrent/TimeUnit;JLjava/util/concurrent/TimeUnit;Z)V

The method's class, feign.Request$Options, is available from the following locations:

    jar:file:/E:/maven-3.8.1/repository/io/github/openfeign/feign-core/10.4.0/feign-core-10.4.0.jar!/feign/Request$Options.class

The class hierarchy was loaded from the following locations:

    feign.Request.Options: file:/E:/maven-3.8.1/repository/io/github/openfeign/feign-core/10.4.0/feign-core-10.4.0.jar


Action:

Correct the classpath of your application so that it contains a single, compatible version of feign.Request$Options

版本冲突

我的springboot 版本是2.3.7.RELEASE,springcloud版本是Hoxton.RELEASE

去除10.4.0版本

    <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-openfeign</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>feign-core</artifactId>
                    <groupId>io.github.openfeign</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>

单独增加10.5.1版本

        <dependency>
            <groupId>io.github.openfeign</groupId>
            <artifactId>feign-core</artifactId>
            <version>10.5.1</version>
        </dependency>

注意pom中有没有排除ribbon的,要删除

 查看配置文件,是否有进行feign单独处理的,如feign超时调用

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值