Error creating bean with name 'nacosConsumerController': Injection of @Reference dependencies is fa
  ZT8lPCn7HRRr 2023年11月26日 21 0

ERROR 13300 --- [ main] o.s.boot.SpringApplication : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nacosConsumerController': Injection of @Reference dependencies is failed; nested exception is java.lang.IllegalStateException: Failed to check the status of the service com.yh.microservice.service2.api.Service2Api. No provider available for the service com.yh.microservice.service2.api.Service2Api from the url spring-cloud://localhost:9090/org.apache.dubbo.registry.RegistryService?application=nacos_consumer&dubbo=2.0.2&interface=com.yh.microservice.service2.api.Service2Api&lazy=false&methods=dubboService2&pid=13300&qos.enable=false&register.ip=192.168.1.4&release=2.7.3&side=consumer&sticky=false&timestamp=1700923971357 to the consumer 192.168.1.4 use dubbo version 2.7.3 at org.apache.dubbo.config.spring.beans.factory.annotation.AnnotationInjectedBeanPostProcessor.postProcessPropertyValues(AnnotationInjectedBeanPostProcessor.java:151) ~[dubbo-2.7.3.jar:2.7.3] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1400) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:849) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) ~[spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) ~[spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE] at com.yh.ConsumerApplication.main(ConsumerApplication.java:11) [classes/:na] Caused by: java.lang.IllegalStateException: Failed to check the status of the service com.yh.microservice.service2.api.Service2Api. No provider available for the service com.yh.microservice.service2.api.Service2Api from the url spring-cloud://localhost:9090/org.apache.dubbo.registry.RegistryService?application=nacos_consumer&dubbo=2.0.2&interface=com.yh.microservice.service2.api.Service2Api&lazy=false&methods=dubboService2&pid=13300&qos.enable=false&register.ip=192.168.1.4&release=2.7.3&side=consumer&sticky=false&timestamp=1700923971357 to the consumer 192.168.1.4 use dubbo version 2.7.3 at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:418) ~[dubbo-2.7.3.jar:2.7.3] at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:329) ~[dubbo-2.7.3.jar:2.7.3] at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:250) ~[dubbo-2.7.3.jar:2.7.3] at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor$ReferenceBeanInvocationHandler.init(ReferenceAnnotationBeanPostProcessor.java:269) ~[dubbo-2.7.3.jar:2.7.3] at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor$ReferenceBeanInvocationHandler.access$100(ReferenceAnnotationBeanPostProcessor.java:242) ~[dubbo-2.7.3.jar:2.7.3] at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.buildInvocationHandler(ReferenceAnnotationBeanPostProcessor.java:236) ~[dubbo-2.7.3.jar:2.7.3] at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.buildProxy(ReferenceAnnotationBeanPostProcessor.java:219) ~[dubbo-2.7.3.jar:2.7.3] at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.doGetInjectedBean(ReferenceAnnotationBeanPostProcessor.java:134) ~[dubbo-2.7.3.jar:2.7.3] at org.apache.dubbo.config.spring.beans.factory.annotation.AnnotationInjectedBeanPostProcessor.getInjectedObject(AnnotationInjectedBeanPostProcessor.java:360) ~[dubbo-2.7.3.jar:2.7.3] at org.apache.dubbo.config.spring.beans.factory.annotation.AnnotationInjectedBeanPostProcessor$AnnotatedFieldElement.inject(AnnotationInjectedBeanPostProcessor.java:540) ~[dubbo-2.7.3.jar:2.7.3] at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE] at org.apache.dubbo.config.spring.beans.factory.annotation.AnnotationInjectedBeanPostProcessor.postProcessPropertyValues(AnnotationInjectedBeanPostProcessor.java:147) ~[dubbo-2.7.3.jar:2.7.3] ... 17 common frames omitted

问题主要是调用方,无法提供服务, 检查nacos的注册中心,发现有2个服务,证明是调用方的问题。 错误的时候,也可以启动到注册中心,但是无法调用需要保证扫描是的实现类的包。

图片.png

【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月26日 0

暂无评论

推荐阅读
  2Vtxr3XfwhHq   2024年05月17日   43   0   0 Java
  8s1LUHPryisj   2024年05月17日   41   0   0 Java
  aRSRdgycpgWt   2024年05月17日   42   0   0 Java
ZT8lPCn7HRRr