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 2.7.3 升级2.7.5 连接不到zookeeper #668

Closed amogege closed 4 years ago

amogege commented 4 years ago

配置文件 加了 dubbo.config-center.timeout: 50000 dubbo.registry.timeout: 40000 但还是报错 错误代码如下: 2020-01-16 17:32:23.666 [main-EventThread] INFO o.a.curator.framework.state.ConnectionStateManager - State change: CONNECTED 2020-01-16 17:32:24.884 [main] INFO org.apache.catalina.core.StandardService - Stopping service [Tomcat] 2020-01-16 17:32:24.889 [main] INFO o.s.b.a.l.ConditionEvaluationReportLoggingListener -

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2020-01-16 17:32:24.897 [main] ERROR org.springframework.boot.SpringApplication - Application run failed java.lang.NullPointerException: null at org.apache.dubbo.registry.integration.RegistryProtocol.register(RegistryProtocol.java:178) at org.apache.dubbo.registry.integration.RegistryProtocol.export(RegistryProtocol.java:209) at org.apache.dubbo.qos.protocol.QosProtocolWrapper.export(QosProtocolWrapper.java:64) at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:60) at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:143) at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java) at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:470) at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:315) at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:287) at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:205) at org.apache.dubbo.config.bootstrap.DubboBootstrap.lambda$exportServices$13(DubboBootstrap.java:873) at java.util.HashMap$Values.forEach(HashMap.java:981) at org.apache.dubbo.config.bootstrap.DubboBootstrap.exportServices(DubboBootstrap.java:861) at org.apache.dubbo.config.bootstrap.DubboBootstrap.start(DubboBootstrap.java:703) at org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener.onContextRefreshedEvent(DubboBootstrapApplicationListener.java:52) at org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener.onApplicationContextEvent(DubboBootstrapApplicationListener.java:45) at org.apache.dubbo.config.spring.context.OneTimeExecutionApplicationContextEventListener.onApplicationEvent(OneTimeExecutionApplicationContextEventListener.java:40) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:403) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:360) at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:897) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:162) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:553) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) at com.am.dubbo.provider.ProviderApplication.main(ProviderApplication.java:28) 2020-01-16 17:32:24.899 [main] INFO o.a.d.s.b.c.e.AwaitingNonWebApplicationListener - [Dubbo] Current Spring Boot Application is about to shutdown... 2020-01-16 17:32:24.908 [Curator-Framework-0] INFO o.a.curator.framework.imps.CuratorFrameworkImpl - backgroundOperationsLoop exiting 2020-01-16 17:32:24.912 [main] INFO org.apache.zookeeper.ZooKeeper - Session: 0x1000000348e0011 closed 2020-01-16 17:32:24.912 [main-EventThread] INFO org.apache.zookeeper.ClientCnxn - EventThread shut down for session: 0x1000000348e0011 2020-01-16 17:32:24.921 [main] INFO o.s.scheduling.concurrent.ThreadPoolTaskExecutor - Shutting down ExecutorService 'applicationTaskExecutor' 2020-01-16 17:32:24.924 [main] INFO o.a.d.c.s.b.f.a.ReferenceAnnotationBeanPostProcessor - class org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor was destroying!

amogege commented 4 years ago

public ProviderModel lookupExportedService(String serviceKey) { return providers.get(serviceKey); } serviceKey = com.am.dubbo.api.UserInfoApi:1.0.0 而providers里面的key是 com.am.dubbo.api.UserInfoApi 少了版本号,导致获取不到数据,报空指针

l343765828 commented 4 years ago

springboot的版本是多少

amogege commented 4 years ago

2.2.2.RELEASE 要加上  dubbo:   config-center:     timeout: 50000   registry:     timeout: 40000 才能连接上 另外 dubbo.provider.version也失效,需要@Service(version="${dubbo.provider.version}")才行  

/****这是《韦炳吉》发的邮件。**/

 

------------------ 原始邮件 ------------------ 发件人: "L343765828"<notifications@github.com>; 发送时间: 2020年1月17日(星期五) 下午3:09 收件人: "apache/dubbo-spring-boot-project"<dubbo-spring-boot-project@noreply.github.com>; 抄送: "复活炳吉"<310105610@qq.com>; "Author"<author@noreply.github.com>; 主题: Re: [apache/dubbo-spring-boot-project] dubbo 2.7.3 升级2.7.5 连接不到zookeeper (#668)

springboot的版本是多少

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

fxc109406 commented 4 years ago

我也遇到了同样的错误,zookeeper肯定是运行正常的,就是连不上,降到2.7.3就一切正常了。org.apache.dubbo的dubbo-spring-boot-starter比com.alibaba.boot的dubbo-spring-boot-starter连接外部zookeeper要慢不少。

mercyblitz commented 4 years ago

Duplicated https://github.com/apache/dubbo-spring-boot-project/issues/657