首页 > 其他分享 >feign调用接口报错No qualifying bean of type '***HttpMessageConverters' available

feign调用接口报错No qualifying bean of type '***HttpMessageConverters' available

时间:2024-04-23 11:24:18浏览次数:22  
标签:available feign HttpMessageConverters No qualifying bean 报错

在整合spring cloud geateway 时,调用了feign接口,报错No qualifying bean of type 'org.springframework.boot.autoconfigure.http.HttpMessageConverters' available

报错信息

feign.codec.EncodeException: No qualifying bean of type 'org.springframework.boot.autoconfigure.http.HttpMessageConverters' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations:

错误原因

Spring Cloud Gateway是基于WebFlux的,是ReactiveWeb,所以HttpMessageConverters不会自动注入。在gateway服务中配置以下Bean,即可解决。

@Configuration
public class FeignConfig {
    @Bean
    @ConditionalOnMissingBean
    public HttpMessageConverters messageConverters(ObjectProvider<HttpMessageConverter<?>> converters) {
        return new HttpMessageConverters(converters.orderedStream().collect(Collectors.toList()));
    }
}

标签:available,feign,HttpMessageConverters,No,qualifying,bean,报错
From: https://www.cnblogs.com/luyifo/p/18152429

相关文章

  • 记录一次Prism报错
    前提:我的WPF程序在进入主程序之前显示登录界面此时不想登录,点击退出的时候报错了报错提示Anexceptionoccurredwhileinitializingmodule'ShellModule'.-Theexceptionmessagewas:Anexceptionhasoccurredwhiletryingtoaddaviewtoregion'AsideRegion'......
  • react native 安装app时报错 ”已安装了签名冲突的应用“
    1.问题描述:reactnative开发完app,手动安装app,报错”已安装了签名冲突的应用“。或者执行命令安装npxreact-nativerun-android--mode=release,报错2.解决方法:直接卸载原来的app发现无效,于是执行:adbuninstall"xxxxx"xxxxx换成你的app名,在这里可以找到:......
  • 蓝牙打印开发代码示例(日拱一卒,有点进步,UUID仍报错)
     packagecom.lingrui.btprint;importandroid.Manifest;importandroid.app.AlertDialog;importandroid.bluetooth.BluetoothAdapter;importandroid.bluetooth.BluetoothDevice;importandroid.bluetooth.BluetoothSocket;importandroid.content.DialogInterface......
  • 使用pyppeteer 下载chromium 报错 python pyppeteer 调用谷歌翻译api
    https://registry.npmmirror.com/binary.html?path=chromium-browser-snapshots/Win_x64/手动下载安装包 修改文件C:\Users\luyan\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyppeteer\chromium_downloader.py #修改这段代码defdownload_chromium()-......
  • mysql添加数据报错
    1452-Cannotaddorupdateachildrow:aforeignkeyconstraintfails('db_student_manager_web'.'s_student',CONSTRAINT'student_clazz_id_foreign'FOREIGNKEY('clazz_id)REFERENCES's_clazz'('id')......
  • k8s node节点报错 dial tcp 127.0.0.1:8080: connect: connection refused
    前言在搭建好kubernetes环境后,master节点拥有control-plane权限,可以正常使用kubectl。但其他node节点无法使用kubectl命令,即使同步过去/root/.kube/config文件到各个node节点上,也不行。解决检查KUBECONFIG变量:确保KUBECONFIG环境变量正确设置。KUBECONFIG......
  • calico配置报错 kubelet.go:2855] "Container runtime network not ready"
    前言配置calico网络插件时,kubectlgetnode报错:NoReadykubectldescribenodenodeName:nodeRoles:<none>Labels:beta.kubernetes.io/arch=amd64beta.kubernetes.io/os=linuxkub......
  • centos系列报错
    centos系列报错一、网络问题1、报错:ping:www.baidu.com:Nameorservicenotknown(centos8)(1)查看网卡配置:[root@CentOS8Shaowenhuanetwork-scripts]#cat/etc/sysconfig/network-scripts/ifcfg-ens160TYPE=EthernetPROXY_METHOD=noneBROWSER_ONLY=noBOOTPROTO=static......
  • 报错:Qt 打开项目找不到Qt自己的头文件
    报错:Qt打开项目找不到Qt自己的头文件问题描述打开一个之前能跑的Qt项目,发现编译报错,很多Qt自己的宏、头文件、基本类都找不到了。问题解决首先排除一下是不是Qt版本问题导致的CMakeLists.txt或qmake的.pro文件问题。CMakeLists.txt的问题好判断,cmake会给出详细的报......
  • Cadence 启动报错——无法检测到主机名
    软件版本:IC617操作系统:CentOS7*WARNING*clsInitfailed:Can'tdeterminehostname.Lockingisnotallowedwithhostname'localhost'.Checkthehostconfiguration....(略)解决方法sudosuhostnamecentos这里的centos可以改为你想要的hostname参考链接:ce......