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 小时前
[Spring]Spring MVC 请求和响应及用到的注解
java·spring·mvc
dawn1912286 小时前
SpringMVC 入门案例详解
java·spring·html·mvc
极客先躯6 小时前
高级java每日一道面试题-2024年9月16日-框架篇-Spring MVC和Struts的区别是什么?
java·spring·面试·mvc·struts2·框架篇·高级java
尘浮生8 小时前
Java项目实战II基于Java+Spring Boot+MySQL的大型商场应急预案管理系统(源码+数据库+文档)
java·开发语言·数据库·spring boot·spring·maven·intellij-idea
尘浮生9 小时前
Java项目实战II基于Java+Spring Boot+MySQL的校园社团信息管理系统(源码+数据库+文档)
java·开发语言·数据库·spring boot·mysql·spring·maven
尘浮生10 小时前
Java项目实战II基于Java+Spring Boot+MySQL的作业管理系统设计与实现(源码+数据库+文档)
java·开发语言·数据库·spring boot·后端·mysql·spring
aloha_78912 小时前
B站宋红康JAVA基础视频教程(chapter14数据结构与集合源码)
java·数据结构·spring boot·算法·spring cloud·mybatis
拉玛干16 小时前
社团周报系统可行性研究-web后端框架对比-springboot,django,gin
数据库·python·spring·golang
程序员大金18 小时前
基于SSM+Vue+MySQL的酒店管理系统
前端·vue.js·后端·mysql·spring·tomcat·mybatis
努力的布布18 小时前
Spring源码-从源码层面讲解声明式事务的运行流程
java·spring