No qualifying bean of type [com.it.service.DeptService] found for dependency
来源:互联网 发布:龙点金手机炒股软件 编辑:程序博客网 时间:2024/05/03 14:04
今天出现了这样一个错误,弄了好久,意思就是我的'deptEmpController没有deptsv依赖,找了好半天,终于找到了原因。
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'deptEmpController': Unsatisfied dependency expressed through field 'deptsv': No qualifying bean of type [com.it.service.DeptService] found for dependency [com.it.service.DeptService]: expected at least 1 bean which qualifies as autowire candidate for this dependency.
Spring管理service(通过xml读取service,利用反射创建实例),controller的时候,由于Controller里面注入了service,但实际并没有找到service的实例化,慢慢找到原来在applicationContext-Service.xml中,没有配置我所注入service,所以没有办法实例化,导致出错
错误的配置(只配置了一个)
applicationContext-Service.xml:
<bean id="empServiceImp" class="com.it.service.imp.EmpServiceImp"></bean>
正确的配置
applicationContext-Service.xml:
<bean id="empServiceImp" class="com.it.service.imp.EmpServiceImp"></bean>
- No qualifying bean of type [com.it.service.DeptService] found for dependency
- No qualifying bean of type [com.zc.service.IFancyService] found for dependency
- No qualifying bean of type [..] found for dependency
- @Autowired - No qualifying bean of type found for dependency
- 解决“No qualifying bean of type found for dependency”办法
- 错误:No qualifying bean of type [cn.itcast.service.CustomerService] found for dependency: expected at
- No qualifying bean of type [com.dao.UserDao] found for dependency:
- No qualifying bean of type [com.jj.mapper.UserMapper] found for dependency
- No matching bean of type [com.spw.service.UserService] found for dependency
- No qualifying bean of type [XXX.XXX] found for dependency 解决方法
- No qualifying bean of type [services.ExportService] found for dependency问题原因
- junit 测试问题 No qualifying bean of type [javax.servlet.http.HttpServletRequest] found for dependency
- 解决:No qualifying bean of type [org.springframework.jdbc.core.JdbcTemplate] found for dependency
- No qualifying bean of type [XXX.XXX.XXX] found for dependency: expected at least 1 bean which q
- 配置ssm项目报错:No qualifying bean of type ... found for dependency ...expected at least 1 bean which
- No qualifying bean of type...found for dependency:expected at least 1 bean which qualifies... 异常解决方案
- No qualifying bean of type found for dependency: expected at least 1 bean which qualifies as autowir
- 出现No qualifying bean of type [com.*.*.dao.InfoDao] found for :错误!
- Synopsys 各软件 Verdi VCS DC PT详细破解说明
- Kali Linux渗透测试实战 1.4 小试牛刀
- React实战-如何快速创建调试一个Demo程序
- 在实验室ubuntu系统上网慢解决方案与原因
- EM算法
- No qualifying bean of type [com.it.service.DeptService] found for dependency
- 欢迎使用CSDN-markdown编辑器
- Kali Linux渗透测试实战 2.1 DNS信息收集
- Android之Fragment初窥门径(接口的简单流程)
- UltraEdit23.20.0.34安装注册以及添加Verilog和VHDL的高亮显示
- Kali Linux渗透测试实战 2.2 操作系统指纹识别
- 一个view上的两个按钮有两个tableview的来回切换功能等,用了auto layout
- markdownpad2注册码
- .NET基础加强笔记