// A code block
// An highlighted block
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'helloServiceImpl' defined in file [D:\IdeaProjects\doubbodemo_provider\target\classes\com\itheima\service\impl\HelloServiceImpl.class]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Failed to register dubbo://192.168.119.1:20881/com.itheima.service.HelloService?anyhost=true&application=dubbodemo_provider&dubbo=2.6.0&generic=false&interface=com.itheima.service.HelloService&methods=sayHello&pid=15852&side=provider×tamp=1602402652822 to registry 192.168.119.128:2181, cause: Failed to register dubbo://192.168.119.1:20881/com.itheima.service.HelloService?anyhost=true&application=dubbodemo_provider&dubbo=2.6.0&generic=false&interface=com.itheima.service.HelloService&methods=sayHello&pid=15852&side=provider×tamp=1602402652822 to zookeeper zookeeper://192.168.119.128:2181/com.alibaba.dubbo.registry.RegistryService?application=dubbodemo_provider&dubbo=2.6.0&interface=com.alibaba.dubbo.registry.RegistryService&pid=15852×tamp=1602402652804, cause: Zookeeper is not connected yet!
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:587)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
解决: 我的Zookeeper是部署在 linux 系统 ,因linux防火墙未关闭, Zookeeper连接失败报错, cause 字样后面的提示真的很重要.