开发者社区 > 云原生 > 正文

Dubbo 2.7.0 Dubbo注册表nacos的问题

maven依赖

org.apache.dubbo dubbo 2.7.0 com.alibaba dubbo-registry-nacos 0.0.2

启动应用程序时,会发生以下错误

java.lang.IllegalStateException: Failed to load extension class(interface: interface org.apache.dubbo.registry.RegistryFactory, class line: com.alibaba.dubbo.registry.nacos.NacosRegistryFactory) in jar:file:/D:/developer-tool/apache-maven-3.5.3/repository/com/alibaba/dubbo-registry-nacos/0.0.2/dubbo-registry-nacos-0.0.2.jar!/META-INF/dubbo/com.alibaba.dubbo.registry.RegistryFactory, cause: com/alibaba/dubbo/registry/support/AbstractRegistryFactory at org.apache.dubbo.common.extension.ExtensionLoader.loadResource(ExtensionLoader.java:675) ~[dubbo-2.7.0.jar:2.7.0] at org.apache.dubbo.common.extension.ExtensionLoader.loadDirectory(ExtensionLoader.java:643) ~[dubbo-2.7.0.jar:2.7.0] at org.apache.dubbo.common.extension.ExtensionLoader.loadExtensionClasses(ExtensionLoader.java:624) ~[dubbo-2.7.0.jar:2.7.0] at org.apache.dubbo.common.extension.ExtensionLoader.getExtensionClasses(ExtensionLoader.java:595) ~[dubbo-2.7.0.jar:2.7.0] at org.apache.dubbo.common.extension.ExtensionLoader.getSupportedExtensions(ExtensionLoader.java:373) ~[dubbo-2.7.0.jar:2.7.0] at org.apache.dubbo.common.extension.factory.SpiExtensionFactory.getExtension(SpiExtensionFactory.java:32) ~[dubbo-2.7.0.jar:2.7.0] at org.apache.dubbo.common.extension.factory.AdaptiveExtensionFactory.getExtension(AdaptiveExtensionFactory.java:47) ~[dubbo-2.7.0.jar:2.7.0] at org.apache.dubbo.common.extension.ExtensionLoader.injectExtension(ExtensionLoader.java:562) ~[dubbo-2.7.0.jar:2.7.0] at org.apache.dubbo.common.extension.ExtensionLoader.createExtension(ExtensionLoader.java:529) ~[dubbo-2.7.0.jar:2.7.0] at org.apache.dubbo.common.extension.ExtensionLoader.getExtension(ExtensionLoader.java:344) ~[dubbo-2.7.0.jar:2.7.0] at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java) ~[dubbo-2.7.0.jar:2.7.0] at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:553) ~[dubbo-2.7.0.jar:2.7.0] at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:402) ~[dubbo-2.7.0.jar:2.7.0] at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:363) ~[dubbo-2.7.0.jar:2.7.0] at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:345) ~[dubbo-2.7.0.jar:2.7.0] at org.apache.dubbo.config.spring.ServiceBean.export(ServiceBean.java:318) ~[dubbo-2.7.0.jar:2.7.0] at org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:112) ~[dubbo-2.7.0.jar:2.7.0] at org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:58) ~[dubbo-2.7.0.jar:2.7.0] at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.1.3.RELEASE.jar:5.1.3.RELEASE] at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.1.3.RELEASE.jar:5.1.3.RELEASE] at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.1.3.RELEASE.jar:5.1.3.RELEASE] at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:398) ~[spring-context-5.1.3.RELEASE.jar:5.1.3.RELEASE] at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:355) ~[spring-context-5.1.3.RELEASE.jar:5.1.3.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:882) ~[spring-context-5.1.3.RELEASE.jar:5.1.3.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:163) ~[spring-boot-2.1.1.RELEASE.jar:2.1.1.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.3.RELEASE.jar:5.1.3.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) ~[spring-boot-2.1.1.RELEASE.jar:2.1.1.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.1.RELEASE.jar:2.1.1.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.1.RELEASE.jar:2.1.1.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.1.RELEASE.jar:2.1.1.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.1.RELEASE.jar:2.1.1.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.1.RELEASE.jar:2.1.1.RELEASE] at com.xxx.Application.main(Application.java:20) [classes/:na] Caused by: java.lang.NoClassDefFoundError: com/alibaba/dubbo/registry/support/AbstractRegistryFactory at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_161] at java.lang.ClassLoader.defineClass(ClassLoader.java:763) ~[na:1.8.0_161] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[na:1.8.0_161] at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) ~[na:1.8.0_161] at java.net.URLClassLoader.access$100(URLClassLoader.java:73) ~[na:1.8.0_161] at java.net.URLClassLoader$1.run(URLClassLoader.java:368) ~[na:1.8.0_161] at java.net.URLClassLoader$1.run(URLClassLoader.java:362) ~[na:1.8.0_161] at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_161] at java.net.URLClassLoader.findClass(URLClassLoader.java:361) ~[na:1.8.0_161] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_161] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338) ~[na:1.8.0_161] at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_161] at java.lang.Class.forName0(Native Method) ~[na:1.8.0_161] at java.lang.Class.forName(Class.java:348) ~[na:1.8.0_161] at org.apache.dubbo.common.extension.ExtensionLoader.loadResource(ExtensionLoader.java:672) ~[dubbo-2.7.0.jar:2.7.0] ... 32 common frames omitted Caused by: java.lang.ClassNotFoundException: com.alibaba.dubbo.registry.support.AbstractRegistryFactory at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_161] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_161] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338) ~[na:1.8.0_161] at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_161] ... 47 common frames omitted

原提问者GitHub用户xiaostart977

展开
收起
学习娃 2023-05-22 17:23:18 144 0
1 条回答
写回答
取消 提交回答
  • 升级了下Dubbo的版本,是可以用的

    https://github.com/dengbin19910916/dubbo-registry-nacos.git

    原回答者GitHub用户dengbin19910916

    2023-05-23 10:28:45
    赞同 展开评论 打赏

阿里云拥有国内全面的云原生产品技术以及大规模的云原生应用实践,通过全面容器化、核心技术互联网化、应用 Serverless 化三大范式,助力制造业企业高效上云,实现系统稳定、应用敏捷智能。拥抱云原生,让创新无处不在。

相关电子书

更多
Dubbo开源现状与2.7规划 立即下载
Dubbo分布式服务治理实战 立即下载
《Dubbo 3.0 前瞻》 立即下载