网络配置一切正确的前提下 一直报以下错误

Caused by: org.I0Itec.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server within timeout: 5000at org.I0Itec.zkclient.ZkClient.connect(ZkClient.java:876)at org.I0Itec.zkclient.ZkClient.(ZkClient.java:98)at org.I0Itec.zkclient.ZkClient.(ZkClient.java:92)at org.I0Itec.zkclient.ZkClient.(ZkClient.java:80)at com.alibaba.dubbo.remoting.zookeeper.zkclient.ZkclientZookeeperClient.(ZkclientZookeeperClient.java:28)at com.alibaba.dubbo.remoting.zookeeper.zkclient.ZkclientZookeeperTransporter.connect(ZkclientZookeeperTransporter.java:10)at com.alibaba.dubbo.remoting.zookeeper.ZookeeperTransporter$Adpative.connect(ZookeeperTransporter$Adpative.java)at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.(ZookeeperRegistry.java:69)at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistryFactory.createRegistry(ZookeeperRegistryFactory.java:37)at com.alibaba.dubbo.registry.support.AbstractRegistryFactory.getRegistry(AbstractRegistryFactory.java:94)at com.alibaba.dubbo.registry.RegistryFactory$Adpative.getRegistry(RegistryFactory$Adpative.java)at com.alibaba.dubbo.registry.integration.RegistryProtocol.getRegistry(RegistryProtocol.java:190)at com.alibaba.dubbo.registry.integration.RegistryProtocol.export(RegistryProtocol.java:109)at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:53)at com.alibaba.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:54)at com.alibaba.dubbo.rpc.Protocol$Adpative.export(Protocol$Adpative.java)at com.alibaba.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:489)at com.alibaba.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:285)at com.alibaba.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:246)at com.alibaba.dubbo.config.ServiceConfig.export(ServiceConfig.java:145)at com.alibaba.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:110)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:393)at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:347)at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:883)at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:128)at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:108)at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:251)at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98)at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116)... 24 more


解决方式:

<dubbo:registry protocol="${dubbo.registry.protocol}" address="${dubbo.registry.address}" timeout="100000"/>

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐