关于使用 import com.alibaba.dubbo.config.annotation.Service; @Service运行时会报错

关于使用 import com.alibaba.dubbo.config.annotation.Service; @Service运行时会报错.
严重: 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 ‘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.springframework.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"/>

你可能感兴趣的:(错误)