mac下 zookeeper启动成功:
到那时启动provider还是启动失败,说zookeeper is not connect yet:
2019-02-10 17:40:35.097 INFO 5534 — [-localhost:2181] org.I0Itec.zkclient.ZkEventThread : Starting ZkClient event thread.
2019-02-10 17:41:05.106 WARN 5534 — [ main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘com.alibaba.dubbo.spring.boot.DubboProviderAutoConfiguration’: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Failed to register dubbo://192.168.0.102:20880/com.dubbo.ServiceAPI?anyhost=true&application=provider&dubbo=2.6.0&generic=false&interface=com.dubbo.ServiceAPI&methods=sendMessage&pid=5534&side=provider×tamp=1549791629973 to registry localhost:2181, cause: Failed to register dubbo://192.168.0.102:20880/com.dubbo.ServiceAPI?anyhost=true&application=provider&dubbo=2.6.0&generic=false&interface=com.dubbo.ServiceAPI&methods=sendMessage&pid=5534&side=provider×tamp=1549791629973 to zookeeper zookeeper://localhost:2181/com.alibaba.dubbo.registry.RegistryService?application=provider&dubbo=2.6.0&interface=com.alibaba.dubbo.registry.RegistryService&pid=5534×tamp=1549791624963, cause: Zookeeper is not connected yet!
2019-02-10 17:41:05.116 INFO 5534 — [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
2019-02-10 17:41:05.125 ERROR 5534 — [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘com.alibaba.dubbo.spring.boot.DubboProviderAutoConfiguration’: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Failed to register dubbo://192.168.0.102:20880/com.dubbo.ServiceAPI?anyhost=true&application=provider&dubbo=2.6.0&generic=false&interface=com.dubbo.ServiceAPI&methods=sendMessage&pid=5534&side=provider×tamp=1549791629973 to registry localhost:2181, cause: Failed to register dubbo://192.168.0.102:20880/com.dubbo.ServiceAPI?anyhost=true&application=provider&dubbo=2.6.0&generic=false&interface=com.dubbo.ServiceAPI&methods=sendMessage&pid=5534&side=provider×tamp=1549791629973 to zookeeper zookeeper://localhost:2181/com.alibaba.dubbo.registry.RegistryService?application=provider&dubbo=2.6.0&interface=com.alibaba.dubbo.registry.RegistryService&pid=5534×tamp=1549791624963, cause: Zookeeper is not connected yet!
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:139) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:419) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1737) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:576) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]