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
升级了下Dubbo的版本,是可以用的
https://github.com/dengbin19910916/dubbo-registry-nacos.git
原回答者GitHub用户dengbin19910916
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
阿里云拥有国内全面的云原生产品技术以及大规模的云原生应用实践,通过全面容器化、核心技术互联网化、应用 Serverless 化三大范式,助力制造业企业高效上云,实现系统稳定、应用敏捷智能。拥抱云原生,让创新无处不在。