apache / dubbo-spring-boot-project

Spring Boot Project for Apache Dubbo
https://dubbo.apache.org
Apache License 2.0
5.41k stars 1.88k forks source link

dubbo-nacos-service-introspection-consumer-sample项目启动报错找不到DemoService #771

Open chengdukm opened 3 years ago

chengdukm commented 3 years ago

1.已经启动ubbo-nacos-service-introspection-provider-sample应用,nacos注册中心查看已注册 2.启动dubbo-nacos-service-introspection-consumer-sample应用,控制台报错


"C:\Program Files\jdk-11.0.9.101-hotspot\bin\java.exe" -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-javaagent:F:\idea\IntelliJ IDEA 2020.2\lib\idea_rt.jar=58367:F:\idea\IntelliJ IDEA 2020.2\bin" -Dfile.encoding=UTF-8 -classpath E:\dubbo-spring-boot-project\dubbo-spring-boot-samples\service-introspection-samples\nacos-samples\consumer-sample\target\classes;D:\maven\org\springframework\boot\spring-boot-starter\2.3.0.RELEASE\spring-boot-starter-2.3.0.RELEASE.jar;D:\maven\org\springframework\boot\spring-boot\2.3.0.RELEASE\spring-boot-2.3.0.RELEASE.jar;D:\maven\org\springframework\spring-context\5.2.6.RELEASE\spring-context-5.2.6.RELEASE.jar;D:\maven\org\springframework\spring-aop\5.2.6.RELEASE\spring-aop-5.2.6.RELEASE.jar;D:\maven\org\springframework\spring-beans\5.2.6.RELEASE\spring-beans-5.2.6.RELEASE.jar;D:\maven\org\springframework\spring-expression\5.2.6.RELEASE\spring-expression-5.2.6.RELEASE.jar;D:\maven\org\springframework\boot\spring-boot-autoconfigure\2.3.0.RELEASE\spring-boot-autoconfigure-2.3.0.RELEASE.jar;D:\maven\org\springframework\boot\spring-boot-starter-logging\2.3.0.RELEASE\spring-boot-starter-logging-2.3.0.RELEASE.jar;D:\maven\org\apache\logging\log4j\log4j-to-slf4j\2.13.2\log4j-to-slf4j-2.13.2.jar;D:\maven\org\apache\logging\log4j\log4j-api\2.13.2\log4j-api-2.13.2.jar;D:\maven\org\slf4j\jul-to-slf4j\1.7.30\jul-to-slf4j-1.7.30.jar;D:\maven\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;D:\maven\org\springframework\spring-core\5.2.6.RELEASE\spring-core-5.2.6.RELEASE.jar;D:\maven\org\springframework\spring-jcl\5.2.6.RELEASE\spring-jcl-5.2.6.RELEASE.jar;D:\maven\org\yaml\snakeyaml\1.26\snakeyaml-1.26.jar;D:\maven\org\apache\dubbo\dubbo-spring-boot-starter\2.7.7\dubbo-spring-boot-starter-2.7.7.jar;D:\maven\org\apache\dubbo\dubbo-spring-boot-autoconfigure\2.7.7\dubbo-spring-boot-autoconfigure-2.7.7.jar;D:\maven\org\apache\dubbo\dubbo-spring-boot-autoconfigure-compatible\2.7.7\dubbo-spring-boot-autoconfigure-compatible-2.7.7.jar;D:\maven\org\apache\dubbo\dubbo\2.7.7\dubbo-2.7.7.jar;D:\maven\com\alibaba\spring\spring-context-support\1.0.6\spring-context-support-1.0.6.jar;D:\maven\io\netty\netty-all\4.1.49.Final\netty-all-4.1.49.Final.jar;D:\maven\com\google\code\gson\gson\2.8.6\gson-2.8.6.jar;D:\maven\com\alibaba\dubbo-registry-nacos\2.7.7\dubbo-registry-nacos-2.7.7.jar;D:\maven\org\apache\dubbo\dubbo-registry-api\2.7.7\dubbo-registry-api-2.7.7.jar;D:\maven\org\apache\dubbo\dubbo-cluster\2.7.7\dubbo-cluster-2.7.7.jar;D:\maven\org\apache\dubbo\dubbo-rpc-api\2.7.7\dubbo-rpc-api-2.7.7.jar;D:\maven\org\apache\dubbo\dubbo-serialization-api\2.7.7\dubbo-serialization-api-2.7.7.jar;D:\maven\org\apache\dubbo\dubbo-remoting-api\2.7.7\dubbo-remoting-api-2.7.7.jar;D:\maven\org\apache\dubbo\dubbo-container-api\2.7.7\dubbo-container-api-2.7.7.jar;D:\maven\org\apache\dubbo\dubbo-metadata-api\2.7.7\dubbo-metadata-api-2.7.7.jar;D:\maven\org\apache\dubbo\dubbo-common\2.7.7\dubbo-common-2.7.7.jar;D:\maven\commons-logging\commons-logging\1.2\commons-logging-1.2.jar;D:\maven\log4j\log4j\1.2.16\log4j-1.2.16.jar;D:\maven\org\javassist\javassist\3.20.0-GA\javassist-3.20.0-GA.jar;D:\maven\com\alibaba\fastjson\1.2.68\fastjson-1.2.68.jar;D:\maven\commons-io\commons-io\2.6\commons-io-2.6.jar;D:\maven\javax\annotation\javax.annotation-api\1.3.2\javax.annotation-api-1.3.2.jar;D:\maven\com\alibaba\nacos\nacos-client\1.2.1\nacos-client-1.2.1.jar;D:\maven\com\alibaba\nacos\nacos-common\1.2.1\nacos-common-1.2.1.jar;D:\maven\org\apache\commons\commons-lang3\3.10\commons-lang3-3.10.jar;D:\maven\com\alibaba\nacos\nacos-api\1.2.1\nacos-api-1.2.1.jar;D:\maven\com\google\guava\guava\22.0\guava-22.0.jar;D:\maven\com\google\code\findbugs\jsr305\1.3.9\jsr305-1.3.9.jar;D:\maven\com\google\errorprone\error_prone_annotations\2.0.18\error_prone_annotations-2.0.18.jar;D:\maven\com\google\j2objc\j2objc-annotations\1.1\j2objc-annotations-1.1.jar;D:\maven\org\codehaus\mojo\animal-sniffer-annotations\1.14\animal-sniffer-annotations-1.14.jar;D:\maven\commons-codec\commons-codec\1.14\commons-codec-1.14.jar;D:\maven\com\fasterxml\jackson\core\jackson-core\2.11.0\jackson-core-2.11.0.jar;D:\maven\com\fasterxml\jackson\core\jackson-databind\2.11.0\jackson-databind-2.11.0.jar;D:\maven\com\fasterxml\jackson\core\jackson-annotations\2.11.0\jackson-annotations-2.11.0.jar;D:\maven\io\prometheus\simpleclient\0.5.0\simpleclient-0.5.0.jar;E:\dubbo-spring-boot-project\dubbo-spring-boot-samples\sample-api\target\classes;D:\maven\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;D:\maven\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;D:\maven\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar org.apache.dubbo.spring.boot.sample.consumer.bootstrap.DubboNacosServiceIntrospectionConsumerBootstrap
log4j:WARN No appenders could be found for logger (org.apache.dubbo.common.logger.LoggerFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
2021-01-07 10:25:53.875  INFO 6892 --- [           main] d.s.b.c.e.WelcomeLogoApplicationListener : 

 :: Dubbo Spring Boot (v2.7.7) : https://github.com/apache/dubbo-spring-boot-project
 :: Dubbo (v2.7.7) : https://github.com/apache/dubbo
 :: Discuss group : dev@dubbo.apache.org

2021-01-07 10:25:53.881  INFO 6892 --- [           main] e.OverrideDubboConfigApplicationListener : Dubbo Config was overridden by externalized configuration {dubbo.application.name=dubbo-nacos-service-introspection-consumer-sample, dubbo.application.qos-enable=false, dubbo.config.multiple=true, dubbo.registry.address=nacos://127.0.0.1:8848/?username=nacos&password=nacos&registry-type=service}

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.3.0.RELEASE)

2021-01-07 10:25:53.943  INFO 6892 --- [           main] cosServiceIntrospectionConsumerBootstrap : Starting DubboNacosServiceIntrospectionConsumerBootstrap on BF-202004200917 with PID 6892 (E:\dubbo-spring-boot-project\dubbo-spring-boot-samples\service-introspection-samples\nacos-samples\consumer-sample\target\classes started by Administrator in E:\dubbo-spring-boot-project\dubbo-spring-boot-samples)
2021-01-07 10:25:53.944  INFO 6892 --- [           main] cosServiceIntrospectionConsumerBootstrap : No active profile set, falling back to default profiles: default
2021-01-07 10:25:53.981  INFO 6892 --- [           main] com.alibaba.spring.util.BeanRegistrar    : The Infrastructure bean definition [Root bean: class [org.apache.dubbo.spring.boot.beans.factory.config.DubboConfigBeanCustomizer]; scope=; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=nullwith name [namePropertyDefaultValueDubboConfigBeanCustomizer] has been registered.
2021-01-07 10:25:54.188  INFO 6892 --- [           main] .b.f.a.ConfigurationBeanBindingRegistrar : The configuration bean definition [name : org.apache.dubbo.config.ApplicationConfig#0, content : Root bean: class [org.apache.dubbo.config.ApplicationConfig]; scope=; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] has been registered.
2021-01-07 10:25:54.189  INFO 6892 --- [           main] com.alibaba.spring.util.BeanRegistrar    : The Infrastructure bean definition [Root bean: class [com.alibaba.spring.beans.factory.annotation.ConfigurationBeanBindingPostProcessor]; scope=; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=nullwith name [configurationBeanBindingPostProcessor] has been registered.
2021-01-07 10:25:54.189  INFO 6892 --- [           main] .b.f.a.ConfigurationBeanBindingRegistrar : The configuration bean definition [name : org.apache.dubbo.config.RegistryConfig#0, content : Root bean: class [org.apache.dubbo.config.RegistryConfig]; scope=; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] has been registered.
2021-01-07 10:25:54.285  INFO 6892 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.apache.dubbo.spring.boot.autoconfigure.DubboAutoConfiguration' of type [org.apache.dubbo.spring.boot.autoconfigure.DubboAutoConfiguration$$EnhancerBySpringCGLIB$$fb2ba6e4] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by javassist.ClassPool (file:/D:/maven/org/javassist/javassist/3.20.0-GA/javassist-3.20.0-GA.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of javassist.ClassPool
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2021-01-07 10:25:54.461  INFO 6892 --- [           main] .a.ConfigurationBeanBindingPostProcessor : The configuration bean [<dubbo:application name="dubbo-nacos-service-introspection-consumer-sample" hostname="BF-202004200917" qosEnable="false" />] have been binding by the configuration properties [{name=dubbo-nacos-service-introspection-consumer-sample, qos-enable=false}]
2021-01-07 10:25:54.473  INFO 6892 --- [           main] .a.ConfigurationBeanBindingPostProcessor : The configuration bean [<dubbo:registry address="nacos://127.0.0.1:8848/?username=nacos&password=nacos&registry-type=service" port="8848" protocol="nacos" />] have been binding by the configuration properties [{address=nacos://127.0.0.1:8848/?username=nacos&password=nacos&registry-type=service}]
2021-01-07 10:25:54.477  INFO 6892 --- [           main] o.a.d.c.s.b.f.a.ReferenceBeanBuilder     : The configBean[type:ReferenceBean] has been built.
2021-01-07 10:25:55.462  WARN 6892 --- [           main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dubboNacosServiceIntrospectionConsumerBootstrap': Injection of @DubboReference dependencies is failed; nested exception is java.lang.IllegalStateException: Failed to check the status of the service org.apache.dubbo.spring.boot.sample.consumer.DemoService. No provider available for the service org.apache.dubbo.spring.boot.sample.consumer.DemoService:1.0.0 from the url service-discovery-registry://127.0.0.1:8848/org.apache.dubbo.registry.RegistryService?application=dubbo-nacos-service-introspection-consumer-sample&dubbo=2.0.2&init=false&interface=org.apache.dubbo.spring.boot.sample.consumer.DemoService&methods=sayHello&pid=6892&qos.enable=false&register.ip=10.198.75.60&release=2.7.7&revision=1.0.0&side=consumer&sticky=false&timestamp=1609986354659&version=1.0.0 to the consumer 10.198.75.60 use dubbo version 2.7.7
2021-01-07 10:25:55.462  INFO 6892 --- [           main] f.a.ReferenceAnnotationBeanPostProcessor : class org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor was destroying!
2021-01-07 10:25:55.467  INFO 6892 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-01-07 10:25:55.474 ERROR 6892 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dubboNacosServiceIntrospectionConsumerBootstrap': Injection of @DubboReference dependencies is failed; nested exception is java.lang.IllegalStateException: Failed to check the status of the service org.apache.dubbo.spring.boot.sample.consumer.DemoService. No provider available for the service org.apache.dubbo.spring.boot.sample.consumer.DemoService:1.0.0 from the url service-discovery-registry://127.0.0.1:8848/org.apache.dubbo.registry.RegistryService?application=dubbo-nacos-service-introspection-consumer-sample&dubbo=2.0.2&init=false&interface=org.apache.dubbo.spring.boot.sample.consumer.DemoService&methods=sayHello&pid=6892&qos.enable=false&register.ip=10.198.75.60&release=2.7.7&revision=1.0.0&side=consumer&sticky=false&timestamp=1609986354659&version=1.0.0 to the consumer 10.198.75.60 use dubbo version 2.7.7
    at com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor.postProcessPropertyValues(AbstractAnnotationBeanPostProcessor.java:146) ~[spring-context-support-1.0.6.jar:na]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1427) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:895) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878) ~[spring-context-5.2.6.RELEASE.jar:5.2.6.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.2.6.RELEASE.jar:5.2.6.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
    at org.apache.dubbo.spring.boot.sample.consumer.bootstrap.DubboNacosServiceIntrospectionConsumerBootstrap.main(DubboNacosServiceIntrospectionConsumerBootstrap.java:41) ~[classes/:na]
Caused by: java.lang.IllegalStateException: Failed to check the status of the service org.apache.dubbo.spring.boot.sample.consumer.DemoService. No provider available for the service org.apache.dubbo.spring.boot.sample.consumer.DemoService:1.0.0 from the url service-discovery-registry://127.0.0.1:8848/org.apache.dubbo.registry.RegistryService?application=dubbo-nacos-service-introspection-consumer-sample&dubbo=2.0.2&init=false&interface=org.apache.dubbo.spring.boot.sample.consumer.DemoService&methods=sayHello&pid=6892&qos.enable=false&register.ip=10.198.75.60&release=2.7.7&revision=1.0.0&side=consumer&sticky=false&timestamp=1609986354659&version=1.0.0 to the consumer 10.198.75.60 use dubbo version 2.7.7
    at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:350) ~[dubbo-2.7.7.jar:2.7.7]
    at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:258) ~[dubbo-2.7.7.jar:2.7.7]
    at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:158) ~[dubbo-2.7.7.jar:2.7.7]
    at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.getOrCreateProxy(ReferenceAnnotationBeanPostProcessor.java:280) ~[dubbo-2.7.7.jar:2.7.7]
    at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.doGetInjectedBean(ReferenceAnnotationBeanPostProcessor.java:149) ~[dubbo-2.7.7.jar:2.7.7]
    at com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor.getInjectedObject(AbstractAnnotationBeanPostProcessor.java:359) ~[spring-context-support-1.0.6.jar:na]
    at com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor$AnnotatedFieldElement.inject(AbstractAnnotationBeanPostProcessor.java:539) ~[spring-context-support-1.0.6.jar:na]
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
    at com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor.postProcessPropertyValues(AbstractAnnotationBeanPostProcessor.java:142) ~[spring-context-support-1.0.6.jar:na]
    ... 17 common frames omitted

Process finished with exit code 1
heposay commented 2 years ago

我也是遇到这种情况,花了好多时间,还是没解决,不知道是什么bug