dubbo 3.2.0-beta.2 注册到zk失败 [AbstractServiceDiscovery] - [DUBBO] No valid instance found, stop registering instance address to registry., dubbo version: 3.2.0-beta.2
- [ ] I have searched the issues of this repository and believe that this is not a duplicate.
Environment
- Dubbo version: 3.2.0-beta.2
- Operating System version: Apple M1 Pro
- Java version: 1.8
Steps to reproduce this issue
- xxx
- xxx
- xxx
Pls. provide [GitHub address] to reproduce this issue.
Expected Behavior
启动成功、注册到zk成功
Actual Behavior
If there is an exception, please attach the exception trace: 启动成功,但是注册到zk失败
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v3.0.0)
2023-01-04T18:08:25.882+08:00 INFO 66698 --- [ restartedMain] c.t.p.App : Starting App using Java 17.0.5 with PID 66698
2023-01-04T18:08:25.914+08:00 INFO 66698 --- [ restartedMain] c.t.p.App : No active profile set, falling back to 1 default profile: "default"
2023-01-04T18:08:25.983+08:00 INFO 66698 --- [ restartedMain] o.s.b.d.r.ChangeableUrls : The Class-Path manifest attribute in /Users/ddd/Documents/maven-repository/com/sun/xml/bind/jaxb-impl/2.3.0/jaxb-impl-2.3.0.jar referenced one or more files that do not exist: file:/Users/ddd/Documents/maven-repository/com/sun/xml/bind/jaxb-impl/2.3.0/jaxb-core.jar
2023-01-04T18:08:25.983+08:00 INFO 66698 --- [ restartedMain] o.s.b.d.r.ChangeableUrls : The Class-Path manifest attribute in /Users/ddd/Documents/maven-repository/com/sun/xml/bind/jaxb-core/2.3.0/jaxb-core-2.3.0.jar referenced one or more files that do not exist: file:/Users/ddd/Documents/maven-repository/com/sun/xml/bind/jaxb-core/2.3.0/jaxb-api.jar
2023-01-04T18:08:25.983+08:00 INFO 66698 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2023-01-04T18:08:25.984+08:00 INFO 66698 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2023-01-04 18:08:27,662 WARN [org.apache.dubbo.config.spring.beans.factory.annotation.ServiceAnnotationPostProcessor] - [DUBBO] No class annotated by Dubbo @Service was found under package [com.xxx], ignore re-scanned classes: 1, dubbo version: 3.2.0-beta.2, current host: 192.168.30.75, error code: 5-28. This may be caused by No annotations were found on the class, go to https://dubbo.apache.org/faq/5/28 to find instructions.
2023-01-04T18:08:27.722+08:00 INFO 66698 --- [ restartedMain] o.s.c.a.ConfigurationClassPostProcessor : Cannot enhance @Configuration bean definition 'org.apache.dubbo.spring.boot.autoconfigure.DubboRelaxedBinding2AutoConfiguration' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'.
2023-01-04T18:08:27.722+08:00 INFO 66698 --- [ restartedMain] o.s.c.a.ConfigurationClassPostProcessor : Cannot enhance @Configuration bean definition 'org.apache.dubbo.spring.boot.autoconfigure.DubboAutoConfiguration' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'.
2023-01-04T18:08:27.971+08:00 INFO 66698 --- [ restartedMain] f.a.ReferenceAnnotationBeanPostProcessor : Register dubbo reference bean: eventService = ReferenceBean:com.xxx.eee.api.EventService() at private com.xxx.eee.api.EventService com.xxx.rrr.aspect.PartnercfgIxxxAspect.eventService
2023-01-04T18:08:28.106+08:00 INFO 66698 --- [ restartedMain] f.a.ReferenceAnnotationBeanPostProcessor : Register dubbo reference bean: yyyVerifyService = ReferenceBean:com.xxx.yyy.api.yyyVerifyService() at private com.xxx.yyy.api.yyyVerifyService com.xxx.platform.service.OrgCostcenterServiceImpl.yyyVerifyService
2023-01-04T18:08:28.106+08:00 INFO 66698 --- [ restartedMain] f.a.ReferenceAnnotationBeanPostProcessor : Register dubbo reference bean: outerCostCenterService = ReferenceBean:com.xxx.yyy.api.OuterCostCenterService() at private com.xxx.yyy.api.OuterCostCenterService com.xxx.platform.service.OrgCostcenterServiceImpl.outerCostCenterService
2023-01-04T18:08:28.129+08:00 INFO 66698 --- [ restartedMain] f.a.ReferenceAnnotationBeanPostProcessor : Register dubbo reference bean: yyyTravlerService = ReferenceBean:com.xxx.yyy.api.yyyTravlerService() at private com.xxx.yyy.api.yyyTravlerService com.xxx.platform.service.UserContactServiceImpl.yyyTravlerService
2023-01-04T18:08:28.167+08:00 INFO 66698 --- [ restartedMain] f.a.ReferenceAnnotationBeanPostProcessor : Register dubbo reference bean: partnerRankService = ReferenceBean:com.xxx.zzz.api.PartnerRankService(check=false,retries=0,timeout=20000) at private com.xxx.zzz.api.PartnerRankService com.xxx.platform.side.remote.QuarkRemoteService.partnerRankService
2023-01-04T18:08:28.167+08:00 INFO 66698 --- [ restartedMain] f.a.ReferenceAnnotationBeanPostProcessor : Register dubbo reference bean: flightRuleService = ReferenceBean:com.xxx.zzz.api.FlightRuleService(check=false,retries=0,timeout=20000) at private com.xxx.zzz.api.FlightRuleService com.xxx.platform.side.remote.QuarkRemoteService.flightRuleService
2023-01-04T18:08:28.167+08:00 INFO 66698 --- [ restartedMain] f.a.ReferenceAnnotationBeanPostProcessor : Register dubbo reference bean: hotelRuleService = ReferenceBean:com.xxx.zzz.api.HotelRuleService(check=false,retries=0,timeout=20000) at private com.xxx.zzz.api.HotelRuleService com.xxx.platform.side.remote.QuarkRemoteService.hotelRuleService
2023-01-04T18:08:28.167+08:00 INFO 66698 --- [ restartedMain] f.a.ReferenceAnnotationBeanPostProcessor : Register dubbo reference bean: paymentRuleService = ReferenceBean:com.xxx.zzz.api.PaymentRuleService(check=false,retries=0,timeout=20000) at private com.xxx.zzz.api.PaymentRuleService com.xxx.platform.side.remote.QuarkRemoteService.paymentRuleService
2023-01-04T18:08:28.167+08:00 INFO 66698 --- [ restartedMain] f.a.ReferenceAnnotationBeanPostProcessor : Register dubbo reference bean: trainRuleService = ReferenceBean:com.xxx.zzz.api.TrainRuleService(check=false,retries=0,timeout=20000) at private com.xxx.zzz.api.TrainRuleService com.xxx.platform.side.remote.QuarkRemoteService.trainRuleService
2023-01-04T18:08:28.167+08:00 INFO 66698 --- [ restartedMain] f.a.ReferenceAnnotationBeanPostProcessor : Register dubbo reference bean: tripRuleService = ReferenceBean:com.xxx.zzz.api.TripRuleService(check=false,retries=0,timeout=20000) at private com.xxx.zzz.api.TripRuleService com.xxx.platform.side.remote.QuarkRemoteService.tripRuleService
2023-01-04T18:08:28.342+08:00 INFO 66698 --- [ restartedMain] f.a.ReferenceAnnotationBeanPostProcessor : class org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor was destroying!
2023-01-04T18:08:29.020+08:00 INFO 66698 --- [ restartedMain] o.s.b.w.e.t.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2023-01-04T18:08:29.032+08:00 INFO 66698 --- [ restartedMain] o.a.c.c.StandardService : Starting service [Tomcat]
2023-01-04T18:08:29.032+08:00 INFO 66698 --- [ restartedMain] o.a.c.c.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.1]
2023-01-04T18:08:29.088+08:00 INFO 66698 --- [ restartedMain] o.a.c.c.C.[.[.[/] : Initializing Spring embedded WebApplicationContext
2023-01-04T18:08:29.089+08:00 INFO 66698 --- [ restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 3104 ms
2023-01-04T18:08:29.150+08:00 INFO 66698 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2023-01-04T18:08:29.152+08:00 INFO 66698 --- [ restartedMain] o.a.d.c.s.c.DubboConfigBeanInitializer : loading dubbo config beans ...
2023-01-04T18:08:29.171+08:00 INFO 66698 --- [ restartedMain] o.a.d.c.s.c.DubboConfigBeanInitializer : dubbo config beans are loaded.
2023-01-04 18:08:29,401 ERROR [org.apache.curator.framework.imps.EnsembleTracker] - Invalid config event received: {server.2=192.168.1.235:12789:13789:participant, server.1=192.168.1.234:12788:13788:participant, server.0=192.168.1.231:12787:13787:participant, version=0}
2023-01-04 18:08:29,402 ERROR [org.apache.curator.framework.imps.EnsembleTracker] - Invalid config event received: {server.2=192.168.1.235:12789:13789:participant, server.1=192.168.1.234:12788:13788:participant, server.0=192.168.1.231:12787:13787:participant, version=0}
2023-01-04T18:08:30.022+08:00 INFO 66698 --- [ restartedMain] o.a.d.c.s.r.ReferenceCreator : The configBean[type:ReferenceConfig<com.xxx.eee.api.EventService>] has been built.
2023-01-04T18:08:30.566+08:00 INFO 66698 --- [ restartedMain] o.a.d.c.s.r.ReferenceCreator : The configBean[type:ReferenceConfig<com.xxx.zzz.api.PartnerRankService>] has been built.
2023-01-04T18:08:30.569+08:00 INFO 66698 --- [ restartedMain] o.a.d.c.s.r.ReferenceCreator : The configBean[type:ReferenceConfig<com.xxx.zzz.api.FlightRuleService>] has been built.
2023-01-04T18:08:30.571+08:00 INFO 66698 --- [ restartedMain] o.a.d.c.s.r.ReferenceCreator : The configBean[type:ReferenceConfig<com.xxx.zzz.api.HotelRuleService>] has been built.
2023-01-04T18:08:30.574+08:00 INFO 66698 --- [ restartedMain] o.a.d.c.s.r.ReferenceCreator : The configBean[type:ReferenceConfig<com.xxx.zzz.api.PaymentRuleService>] has been built.
2023-01-04T18:08:30.577+08:00 INFO 66698 --- [ restartedMain] o.a.d.c.s.r.ReferenceCreator : The configBean[type:ReferenceConfig<com.xxx.zzz.api.TrainRuleService>] has been built.
2023-01-04T18:08:30.579+08:00 INFO 66698 --- [ restartedMain] o.a.d.c.s.r.ReferenceCreator : The configBean[type:ReferenceConfig<com.xxx.zzz.api.TripRuleService>] has been built.
2023-01-04T18:08:30.585+08:00 INFO 66698 --- [ restartedMain] o.a.d.c.s.r.ReferenceCreator : The configBean[type:ReferenceConfig<com.xxx.yyy.api.yyyVerifyService>] has been built.
2023-01-04T18:08:30.587+08:00 INFO 66698 --- [ restartedMain] o.a.d.c.s.r.ReferenceCreator : The configBean[type:ReferenceConfig<com.xxx.yyy.api.OuterCostCenterService>] has been built.
2023-01-04T18:08:30.652+08:00 INFO 66698 --- [ restartedMain] o.a.d.c.s.r.ReferenceCreator : The configBean[type:ReferenceConfig<com.xxx.yyy.api.yyyTravlerService>] has been built.
2023-01-04T18:08:31.062+08:00 INFO 66698 --- [ restartedMain] o.s.b.w.e.t.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
*********ApacheProviderTraceFilter initial************
2023-01-04 18:08:31,467 ERROR [org.apache.curator.framework.imps.EnsembleTracker] - Invalid config event received: {server.2=192.168.1.235:12789:13789:participant, server.1=192.168.1.234:12788:13788:participant, server.0=192.168.1.231:12787:13787:participant, version=0}
2023-01-04 18:08:31,467 ERROR [org.apache.curator.framework.imps.EnsembleTracker] - Invalid config event received: {server.2=192.168.1.235:12789:13789:participant, server.1=192.168.1.234:12788:13788:participant, server.0=192.168.1.231:12787:13787:participant, version=0}
2023-01-04 18:08:31,511 ERROR [org.apache.curator.framework.imps.EnsembleTracker] - Invalid config event received: {server.2=192.168.1.235:12789:13789:participant, server.1=192.168.1.234:12788:13788:participant, server.0=192.168.1.231:12787:13787:participant, version=0}
2023-01-04 18:08:31,512 ERROR [org.apache.curator.framework.imps.EnsembleTracker] - Invalid config event received: {server.2=192.168.1.235:12789:13789:participant, server.1=192.168.1.234:12788:13788:participant, server.0=192.168.1.231:12787:13787:participant, version=0}
*********ApacheConsumerTraceFilter initial************
2023-01-04 18:08:31,764 WARN [org.apache.dubbo.registry.client.ServiceDiscoveryRegistryDirectory] - [DUBBO] Received url with EMPTY protocol, will clear all available addresses., dubbo version: 3.2.0-beta.2, current host: 192.168.30.75, error code: 4-1. This may be caused by , go to https://dubbo.apache.org/faq/4/1 to find instructions.
2023-01-04T18:08:32.088+08:00 INFO 66698 --- [nio-8080-exec-2] o.a.c.c.C.[.[.[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2023-01-04T18:08:32.088+08:00 INFO 66698 --- [nio-8080-exec-2] o.s.w.s.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2023-01-04T18:08:32.089+08:00 INFO 66698 --- [nio-8080-exec-2] o.s.w.s.DispatcherServlet : Completed initialization in 1 ms
2023-01-04 18:08:32,348 WARN [org.apache.dubbo.config.deploy.DefaultMetricsServiceExporter] - [DUBBO] The MetricsConfig not exist, will not export metrics service., dubbo version: 3.2.0-beta.2, current host: 192.168.30.75
2023-01-04 18:08:39,130 WARN [org.apache.dubbo.registry.client.AbstractServiceDiscovery] - [DUBBO] No valid instance found, stop registering instance address to registry., dubbo version: 3.2.0-beta.2, current host: 192.168.30.75, error code: 1-12. This may be caused by , go to https://dubbo.apache.org/faq/1/12 to find instructions.
2023-01-04T18:08:40.258+08:00 INFO 66698 --- [ restartedMain] c.t.p.App : Started App in 15.509 seconds (process running for 16.198)
在应用只有纯 Reference 的时候(没有发布任何服务),Dubbo 无法注册到注册中心。此时注册到注册中心也没有意义,没有任何消费端能消费一个没有发布任何服务的服务端。
有暴漏服务的, @AlbumenJ
@DubboService
@Service
public class UserServiceImpl implements UserService {
// 略
}
@EnableDubbo 注解加了吗。从日志里面看没扫描到这个 DubboService
@AlbumenJ 这个@EnableDubbo 注解加了,加在启动类上
2023-01-04 18:08:27,662 WARN [org.apache.dubbo.config.spring.beans.factory.annotation.ServiceAnnotationPostProcessor] - [DUBBO] No class annotated by Dubbo @Service was found under package [com.xxx], ignore re-scanned classes: 1, dubbo version: 3.2.0-beta.2, current host: 192.168.30.75, error code: 5-28. This may be caused by No annotations were found on the class, go to https://dubbo.apache.org/faq/5/28 to find instructions.
这个日志提示了没扫描到 Service 的 bean
@ddfeiyu 兄弟你解决了吗,我启动后也有这个警告,不知道什么原因,用3.1.1和3.1.8的版本都有这个警告,但是功能目前看是没有什么影响,debug跟了下,发现下面这里判断的时候host为null和port为0,所以打印了警告

有大佬解答下什么原因导致的host和port取不到值吗?是我哪里配置的问题吗,程序跑目前没问题,可以调用到app2Registry这个注册中心里的提供者接口
我的配置如下:
dubbo:
protocol:
name: dubbo
port: 20882
host: 192.168.1.66
registries:
app1Registry:
protocol: zookeeper
address: 127.0.0.1:2181
check: false
default: true
#下面这个zk是另外一个项目用的,我当前这个项目用到下面zk中的一个dubbo接口了,所以配置了下面的zk,使用不注册配置,register: false
app2Registry:
protocol: zookeeper
address: 192.168.1.2:2181
check: false
default: false
register: false
application:
name: dubbo-app1
metadata-type: remote
register-mode: interface
然后如果只配置一个zk的话,一样也有这个警告,不知道是哪里的问题了
这个应该是服务还没发布导致的
这个应该是服务还没发布导致的
可以详细解释下什么原因吗?谢谢
就应用级服务发现注册的时候服务还没发布完毕,这个时候没法注册到注册中心。这种终态一般都会对齐的