Which Component
我想在Spring Cloud Alibaba + Dubbo环境下使用grpc( I want to use grpc in Spring Cloud Alibaba + Dubbo environment)
Component Version:
Spring Boot:2.3.3.RELEASE
Spring Cloud:Hoxton.SR8
Spring Cloud Alibaba:2.2.3.RELEASE
Dubbo version: 2.7.8
Describe what problem you have encountered
按照Dubbo官方提供的示例,能够正常启动Provider程序(According to the official example provided by Dubbo, the Provider program can be started normally)
2020-12-26 22:11:13.403 INFO 19724 --- [ main] org.apache.dubbo.config.ServiceConfig : [DUBBO] Export dubbo service org.example.grpc.DubboFooServiceGrpc$IFooService to local registry url : injvm://127.0.0.1/org.example.grpc.DubboFooServiceGrpc$IFooService?anyhost=true&application=dubbo-grpc-provider&bind.ip=192.168.0.102&bind.port=50052&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&interface=org.example.grpc.DubboFooServiceGrpc$IFooService&methods=sayHello,sayHelloAsync&pid=19724&qos.enable=false&release=2.7.8&side=provider×tamp=1608991873391, dubbo version: 2.7.8, current host: 192.168.0.102
2020-12-26 22:11:13.403 INFO 19724 --- [ main] org.apache.dubbo.config.ServiceConfig : [DUBBO] Register dubbo service org.example.grpc.DubboFooServiceGrpc$IFooService url grpc://192.168.0.102:50052/org.example.grpc.DubboFooServiceGrpc$IFooService?anyhost=true&application=dubbo-grpc-provider&bind.ip=192.168.0.102&bind.port=50052&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&interface=org.example.grpc.DubboFooServiceGrpc$IFooService&methods=sayHello,sayHelloAsync&pid=19724&qos.enable=false&release=2.7.8&side=provider×tamp=1608991873391 to registry registry://localhost:9090/org.apache.dubbo.registry.RegistryService?application=dubbo-grpc-provider&dubbo=2.0.2&pid=19724&qos.enable=false®istry=spring-cloud&release=2.7.8×tamp=1608991873391, dubbo version: 2.7.8, current host: 192.168.0.102
2020-12-26 22:11:13.495 INFO 19724 --- [ main] c.a.c.dubbo.registry.DubboCloudRegistry : [DUBBO] Register: grpc://192.168.0.102:50052/org.example.grpc.DubboFooServiceGrpc$IFooService?anyhost=true&application=dubbo-grpc-provider&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&interface=org.example.grpc.DubboFooServiceGrpc$IFooService&methods=sayHello,sayHelloAsync&pid=19724&release=2.7.8&side=provider×tamp=1608991873391, dubbo version: 2.7.8, current host: 192.168.0.102
2020-12-26 22:11:14.597 INFO 19724 --- [ main] o.s.cloud.commons.util.InetUtils : Cannot determine local hostname
2020-12-26 22:11:14.597 INFO 19724 --- [ main] c.a.c.dubbo.registry.DubboCloudRegistry : [DUBBO] Subscribe: provider://192.168.0.102:50052/org.example.grpc.DubboFooServiceGrpc$IFooService?anyhost=true&application=dubbo-grpc-provider&bind.ip=192.168.0.102&bind.port=50052&category=configurators&check=false&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&interface=org.example.grpc.DubboFooServiceGrpc$IFooService&methods=sayHello,sayHelloAsync&pid=19724&qos.enable=false&release=2.7.8&side=provider×tamp=1608991873391, dubbo version: 2.7.8, current host: 192.168.0.102
2020-12-26 22:11:14.604 INFO 19724 --- [ main] m.DynamicConfigurationServiceNameMapping : [DUBBO] Dubbo service[null] mapped to interface name[org.example.grpc.DubboFooServiceGrpc$IFooService]., dubbo version: 2.7.8, current host: 192.168.0.102
2020-12-26 22:11:14.613 INFO 19724 --- [ main] o.a.d.config.bootstrap.DubboBootstrap : [DUBBO] DubboBootstrap is ready., dubbo version: 2.7.8, current host: 192.168.0.102
2020-12-26 22:11:14.613 INFO 19724 --- [ main] o.a.d.config.bootstrap.DubboBootstrap : [DUBBO] DubboBootstrap has started., dubbo version: 2.7.8, current host: 192.168.0.102
2020-12-26 22:11:14.615 INFO 19724 --- [ main] o.example.ProviderBootstrapApplication : Started ProviderBootstrapApplication in 11.68 seconds (JVM running for 12.447)
但是无法正常启动Consumer程序(But the Consumer program cannot be started normally)
Caused by: java.lang.IllegalStateException: Failed to subscribe consumer://192.168.0.102/org.example.grpc.DubboFooServiceGrpc$IFooService?application=dubbo-grpc-consumer&category=providers,configurators,routers&dubbo=2.0.2&init=false&interface=org.example.grpc.DubboFooServiceGrpc$IFooService&methods=sayHello,sayHelloAsync&pid=12136&qos.enable=false&release=2.7.8&side=consumer&sticky=false×tamp=1608992011953, cause: null
at org.apache.dubbo.registry.support.FailbackRegistry.subscribe(FailbackRegistry.java:350) ~[dubbo-2.7.8.jar:2.7.8]
at org.apache.dubbo.registry.ListenerRegistryWrapper.subscribe(ListenerRegistryWrapper.java:105) ~[dubbo-2.7.8.jar:2.7.8]
at org.apache.dubbo.registry.integration.RegistryDirectory.subscribe(RegistryDirectory.java:185) ~[dubbo-2.7.8.jar:2.7.8]
at org.apache.dubbo.registry.integration.RegistryProtocol.doRefer(RegistryProtocol.java:469) ~[dubbo-2.7.8.jar:2.7.8]
at org.apache.dubbo.registry.integration.RegistryProtocol.refer(RegistryProtocol.java:454) ~[dubbo-2.7.8.jar:2.7.8]
at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:72) ~[dubbo-2.7.8.jar:2.7.8]
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:161) ~[dubbo-2.7.8.jar:2.7.8]
at org.apache.dubbo.qos.protocol.QosProtocolWrapper.refer(QosProtocolWrapper.java:73) ~[dubbo-2.7.8.jar:2.7.8]
at org.apache.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java) ~[dubbo-2.7.8.jar:2.7.8]
at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:367) ~[dubbo-2.7.8.jar:2.7.8]
at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:305) ~[dubbo-2.7.8.jar:2.7.8]
at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:205) ~[dubbo-2.7.8.jar:2.7.8]
at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.doGetInjectedBean(ReferenceAnnotationBeanPostProcessor.java:144) ~[dubbo-2.7.8.jar:2.7.8]
at com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor.getInjectedObject(AbstractAnnotationBeanPostProcessor.java:362) ~[spring-context-support-1.0.10.jar:na]
at com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor$AnnotatedFieldElement.inject(AbstractAnnotationBeanPostProcessor.java:542) ~[spring-context-support-1.0.10.jar:na]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor.postProcessPropertyValues(AbstractAnnotationBeanPostProcessor.java:145) ~[spring-context-support-1.0.10.jar:na]
Caused by: java.lang.NullPointerException: null
at com.alibaba.cloud.dubbo.registry.DubboCloudRegistry.lambda$null$5(DubboCloudRegistry.java:293) ~[spring-cloud-starter-dubbo-2.2.3.RELEASE.jar:2.2.3.RELEASE]
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) ~[na:na]
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) ~[na:na]
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) ~[na:na]
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[na:na]
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[na:na]
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497) ~[na:na]
at com.alibaba.cloud.dubbo.registry.DubboCloudRegistry.lambda$cloneExportedURLs$6(DubboCloudRegistry.java:311) ~[spring-cloud-starter-dubbo-2.2.3.RELEASE.jar:2.2.3.RELEASE]
at java.base/java.util.ArrayList.forEach(ArrayList.java:1540) ~[na:na]
at com.alibaba.cloud.dubbo.registry.DubboCloudRegistry.cloneExportedURLs(DubboCloudRegistry.java:284) ~[spring-cloud-starter-dubbo-2.2.3.RELEASE.jar:2.2.3.RELEASE]
at com.alibaba.cloud.dubbo.registry.DubboCloudRegistry.getExportedURLs(DubboCloudRegistry.java:265) ~[spring-cloud-starter-dubbo-2.2.3.RELEASE.jar:2.2.3.RELEASE]
at com.alibaba.cloud.dubbo.registry.DubboCloudRegistry.subscribeURLs(DubboCloudRegistry.java:240) ~[spring-cloud-starter-dubbo-2.2.3.RELEASE.jar:2.2.3.RELEASE]
at com.alibaba.cloud.dubbo.registry.DubboCloudRegistry.subscribeURLs(DubboCloudRegistry.java:227) ~[spring-cloud-starter-dubbo-2.2.3.RELEASE.jar:2.2.3.RELEASE]
at com.alibaba.cloud.dubbo.registry.DubboCloudRegistry.lambda$subscribeURLs$2(DubboCloudRegistry.java:206) ~[spring-cloud-starter-dubbo-2.2.3.RELEASE.jar:2.2.3.RELEASE]
Which Component
我想在Spring Cloud Alibaba + Dubbo环境下使用grpc(
I want to use grpc in Spring Cloud Alibaba + Dubbo environment
)Describe what problem you have encountered
According to the official example provided by Dubbo, the Provider program can be started normally
)But the Consumer program cannot be started normally
)Describe what information you have read
我提供了一个GitHub地址(
provided a GitHub address
)