###No qualifying bean of type [cn.e3.manager.service.ItemCatService] ,web注入service失败
来源:互联网 发布:提升网络安全意识 编辑:程序博客网 时间:2024/06/05 02:22
====【一直以为是和之前一样:是 ①注解没写,②Spring配置没有扫描service包的问题】
===找啊找找不到:
还好有源码可参考,发现是dubbo服务 配置文件 ,写错了。【忘记在web端添加 引用dubbo服务】
===和dubbo,初次见面,送个bug不成敬意。。。
正确:
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"xmlns:context="http://www.springframework.org/schema/context"xmlns:dubbo="http://code.alibabatech.com/schema/dubbo" xmlns:mvc="http://www.springframework.org/schema/mvc"xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsdhttp://code.alibabatech.com/schema/dubbohttp://code.alibabatech.com/schema/dubbo/dubbo.xsdhttp://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsdhttp://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsdhttp://www.springframework.org/schema/mvchttp://www.springframework.org/schema/mvc/spring-mvc-4.0.xsdhttp://www.springframework.org/schema/utilhttp://www.springframework.org/schema/util/spring-util-4.0.xsd"><!-- 消费方应用名,用于计算依赖关系,不是匹配条件,不要与提供方一样 --><dubbo:application name="manager-web" /><!-- 使用multicast广播注册中心暴露发现服务地址 --><dubbo:registry address="zookeeper://192.168.108.128:2181" /><!-- 生成远程服务代理,可以和本地bean一样使用demoService --><!-- 商品服务 --><dubbo:reference id="itemService"interface="cn.e3.manager.service.ItemService" timeout="1000000" retries="2"/><!-- 商品类别服务 --><dubbo:reference id="itemCatService"interface="cn.e3.manager.service.ItemCatService" timeout="1000000" retries="2"/></beans>
错误的:
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"xmlns:context="http://www.springframework.org/schema/context"xmlns:dubbo="http://code.alibabatech.com/schema/dubbo" xmlns:mvc="http://www.springframework.org/schema/mvc"xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsdhttp://code.alibabatech.com/schema/dubbohttp://code.alibabatech.com/schema/dubbo/dubbo.xsdhttp://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsdhttp://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsdhttp://www.springframework.org/schema/mvchttp://www.springframework.org/schema/mvc/spring-mvc-4.0.xsdhttp://www.springframework.org/schema/utilhttp://www.springframework.org/schema/util/spring-util-4.0.xsd"><!-- 消费方应用名,用于计算依赖关系,不是匹配条件,不要与提供方一样 --><dubbo:application name="manager-web" /><!-- 使用multicast广播注册中心暴露发现服务地址 --><!-- 我的虚拟机1 ====NAT模式--><dubbo:registry address="zookeeper://192.168.108.128:2181" /> <!-- 我的虚拟机2 克隆 ====桥接模式--><!-- <dubbo:registry address="zookeeper://192.168.167.78:2181" /> --><!-- 生成远程服务代理,可以和本地bean一样使用demoService --><!-- ====【timeout="1000000" retries="2"】解决服务超时问题,默认时间太短。单位毫秒,超时重试2次======= --> <!-- ====【dubbo的负载均衡】还没体现。===一台服务器超时,dubbo让客户端访问另一台服务器。==== --><!-- <dubbo:reference id="itemService" --> <!-- interface="cn.e3.manager.service.ItemService" /> --><dubbo:reference id="itemService"interface="cn.e3.manager.service.ItemService" timeout="1000000" retries="2"/></beans>
=======下次就熟悉了。和CXF类似,web service两端都要配置。
但是###### dubbo【每添加一个类都要 修改 两端的服务配置】
====#####【添加类:修改了配置了service,忘记配置了web端】。是我错误原因
====#####【错误提示:普通思路,实在找不到,就思考是否使用了新技术。====新技术运用不熟,常常导致错误。】
阅读全文
0 0
- ###No qualifying bean of type [cn.e3.manager.service.ItemCatService] ,web注入service失败
- 错误:No qualifying bean of type [cn.itcast.service.CustomerService] found for dependency: expected at
- Bean对象注入失败 .NoSuchBeanDefinitionException: No qualifying bean of type..
- spring容器无法注入service(No qualifying bean of type)
- No qualifying bean of type 'com.zjw.service.SysService'错误
- No qualifying bean of type [com.zc.service.IFancyService] found for dependency
- No qualifying bean of type [com.it.service.DeptService] found for dependency
- No qualifying bean of type
- no qualifying bean of type [...] is define
- springmvc No qualifying bean of type
- NoSuchBeanDefinitionException: No qualifying bean of type
- NoSuchBeanDefinitionException:No qualifying bean of type 解决方法
- No qualifying bean of type [] is defined
- No qualifying bean of type(xxxxxx)
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [cn.itca
- No unique bean of type [ *.service.*Service] is defined
- 关于dao层Bean注入失败报No qualifying bean of type [xxx.xxx.xxx.xxx] is defined错误的问题
- No qualifying bean of type 'com.yubai.bean.BeanWayService' available
- springboot(九):定时任务
- PHP+SQL Server 连接数据库(一)
- Android Studio多渠道打包配置
- 基于TCP的Socket编程
- 公众号从菜鸟到高手的进化:微信公众号原创保护功能
- ###No qualifying bean of type [cn.e3.manager.service.ItemCatService] ,web注入service失败
- sqoop的安装与工作机制
- 对指针数组,数组指针,函数指针, 函数指针数组,指向函数指针数组的指针的理解
- 网络编程
- Interleaving String
- IntelliJ IDEA编辑区主题修改
- opencv摄像头
- Retrofit2+Rxjava2如何主动取消网络请求
- gradle-x.x-all.zip各个版本的离线包集合