关于使用 import com.alibaba.dubbo.config.annotation.Service; @Service运行时会报错.
严重: Exception sending context initialized event to listener instance of class org.spring work.web.context.ContextLoaderListener
org.spring work.beans.factory.BeanCreationException: Error creating bean with name ‘itemSearchServiceImpl’ defined in file [D:\\A\\javaee_shopping_code\\pinyougou_parent\\pinyougou_search_service\\target\\classes\\com\\pinyougou\\search\\service\\impl\\ItemSearchServiceImpl.class]: Initialization of bean failed; nested exception is org.I0Itec.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server within timeout: 5000
超时错误. 并且修改超时时间也没用
但是使用import org.spring work.stereotype.Service; 运行时却不会报错的问题
首先看zookeeper所在的服务器是否开启
再看看
配置dubbo的配置文件是否有错误
我的dubbo配置文件
<dubbo:protocol name=\"dubbo\" port=\"20884\"></dubbo:protocol>
<dubbo:application name=\"pinyougou-search-service\"/>
/////////////////////////////////////////////////////////////
<dubbo:registry address=\"zookeeper://192.168.25.135:2181\"/>
////////////////////////////////////////////////////////////
<dubbo:annotation package=\"com.pinyougou.search.service.impl\" />
我的问题是配置zookeeper的ip地址错误.配置成其他服务器的ip
////////////////////////前//////////////////////////////
<dubbo:registry address=\"zookeeper://192.168.25.135:2181\"/>
////////////////////////后//////////////////////////////////
<dubbo:registry address=\"zookeeper://192.168.25.128:2181\"/>
继续阅读与本文标签相同的文章
网络编程零基础如何入门
Linux进阶命令和Shell编程
-
万余平方米演示自动驾驶,世界智能网联汽车大会来了!
2026-05-19栏目: 教程
-
独家解读 etcd 3.4版本 |云原生生态周报 Vol. 18
2026-05-19栏目: 教程
-
5大高清免费无版权图片网站,设计、自媒体都不是问题,值得收藏
2026-05-19栏目: 教程
-
物联网平台实用技巧:设备端检测自己是否在线
2026-05-19栏目: 教程
-
阿里云代金券+9折优惠码实践,原价2381元的云服务器实际购买价1943元
2026-05-19栏目: 教程
