Spring Cloud 只提供dubbo接口 应用层发布项目报 Unsupported protocol 问题修复

项目里面有一个项目使用的Spring Cloud 框架开发一个授权服务,此服务提供了dubbo接口,但是应用层每次发布的时候出现如下错误

错误信息:

java 复制代码
[DUBBO] Unsupported protocol., dubbo version: 3.1.6, current host: xxx.xxx.xxx.xxx, error code: 4-1. 
This may be caused by protocol extension does not installed, 
go to https://dubbo.apache.org/faq/4/1 to find instructions. ,

详细错误信息

java 复制代码
java.lang.IllegalStateException: Unsupported protocol rest in notified url: DefaultServiceInstance{serviceName='xxx-service', host='xxx.xxx.xxx.xxxx', port=8080, enabled=true, healthy=true, metadata={t=3, preserved.register.source=SPRING_CLOUD, __micro.service.app.id__=xxxxxxxxxxxx, opensergo.io/canary=xxxxxxxxxxxx}}, null from registry naco to consumer xxx.xxx.xxx.x, supported protocol: [dubbo, injvm, mock, registry, service-discovery-registry, tri]

原因

框架里面的配置

spring.cloud.nacos.discovery.enabled 默认是true, 授权服务启动的时候会在naco 里面注册一个服务名为【SPRING_CLOUD】的 ,这个协议包含reset, 但是调用方只支持了dubbo,就出现了上述错误。

解决方案:

java 复制代码
spring.cloud.nacos.discovery.enabled=false
相关推荐
凤山老林6 小时前
SpringBoot 3 启用 spring.factories 后如何升级替换原有的 spring.factories ?
spring boot·后端·spring
小罗水7 小时前
第1章 大模型、企业知识库与 RAG 平台概述
java·spring
qq_185198697 小时前
骆驼任务Flowable + Apache Camel 集成
spring·apache·flowable
lichuangcsdn8 小时前
【Spring AI 学习(一)】spring ai是什么
人工智能·学习·spring·spring ai
吃饱了得干活1 天前
@Transactional 又失效了?把这 8 个坑全填了!
java·后端·spring
今天AI了吗1 天前
Spring AI 框架实战:Java 后端集成大模型的架构设计与工程落地
java·人工智能·python·spring·机器学习
乐观的Terry1 天前
9、发布系统-Webhook自动发布
java·spring boot·spring·spring cloud·mybatis
一路向北North1 天前
Spring AI(5) :对话机器人-会话记忆
java·后端·spring
Q渡劫1 天前
MinIO 从下载到集成 Spring Boot 完整教程
spring boot·spring·maven
lymboy1 天前
Spring AI的工具调用循环,本质就是ReAct:一次源码级拆解
人工智能·spring·react.js