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
相关推荐
百锦再8 小时前
Java 并发编程进阶,从线程池、锁、AQS 到并发容器与性能调优全解析
java·开发语言·jvm·spring·kafka·tomcat·maven
NGC_661111 小时前
SSM vs SpringBoot+MyBatis 对比
spring
深蓝轨迹12 小时前
@Autowired与@Resource:Spring依赖注入注解核心差异剖析
java·python·spring·注解
爱丽_13 小时前
Pinia 状态管理:模块化、持久化与“权限联动”落地
java·前端·spring
希望永不加班14 小时前
SpringBoot 核心配置文件:application.yml 与 application.properties
java·spring boot·后端·spring
我真会写代码15 小时前
Spring面试高频题:从基础到源码,通俗拆解+避坑指南
java·spring·面试
cyforkk19 小时前
Spring AOP 核心揭秘:ProceedingJoinPoint 与反射机制详解
java·python·spring
spencer_tseng20 小时前
java.lang.ClassNotFoundException: org.slf4j.Logger
java·spring·maven
小江的记录本20 小时前
【VO、DTO、Entity】VO、DTO、Entity三大核心数据对象全解析(附核心对比表 + 代码示例)
java·数据库·spring boot·spring·架构·mybatis·数据库架构
SuniaWang21 小时前
《Spring AI + 大模型全栈实战》学习手册系列·专题一:《RAG技术全景解析:从原理到架构设计》
java·javascript·人工智能·spring boot·后端·spring·架构