严重: StandardWrapper.Throwable org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'itemSearchController' defined in file [C:\codespace\pinyougou-parent\pinyougou-search-web\target\classes\com\pinyougou\search\controller\ItemSearchController.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanInitializationException: Failed to init remote service reference at filed itemSearchService in class com.pinyougou.search.controller.ItemSearchController; nested exception is java.lang.IllegalStateException: Failed to check the status of the service com.pinyougou.search.service.ItemSearchService. No provider available for the service com.pinyougou.search.service.ItemSearchService from the url zookeeper://192.168.25.135:2181/com.alibaba.dubbo.registry.RegistryService?application=pinyougou-search-web&dubbo=2.8.4&interface=com.pinyougou.search.service. ItemSearchService&methods=search&pid=8600&revision=0.0.5-SNAPSHOT&side=consumer×tam p=1565522609857 to the consumer 192.168.211.1 use dubbo version 2.8.4
org.springframework.beans.factory.BeanCreationException: Error creating bean with name
此为注入异常,bean没有实例到spring容器中,查看spring配置,有没有扫到这个bean或配置这个beanjava
出现该异常通常为如下几点:web
1.补全注解spring
@Component() "对象的名称"至关于bean标签的id属性,若是类不属于javaEE三层架构中的任意一层,那么使用就使用@Component @Controller 通常用于表现层的注解。 做用和component @Service 通常用于业务层的注解。 做用和component @Repository 通常用于持久层的注解。 做用和component @Autowired 优先根据类型注入数据,若是有惟一的对象,那么就能成功注入.若是没有惟一的对象 那么就自动根据变量名和ioc容器对象的名称进行匹配,若是变量名称都没法对应上,那么就报错 @Reference @Reference注入的是分布式中的远程服务对象 来自dubbo服务
2.查看xml是否正确架构
<dubbo:protocol name="dubbo" port="20884"/> <dubbo:application name="quasimodo-search-service"/> <dubbo:registry address="zookeeper://192.168.25.135:2181"/> <dubbo:annotation package="com.quasimodo.search.service.impl" />