关于No qualifying bean of type [XXX.XXX] found for dependency 的一次记录
异常开始于spring+springmvc+mybatis 注解配置,启动tomcat服务器出现No qualifying bean of type [com.***.service] found for dependency的异常,令人疑惑的是这个包里根本没有我需要用到的类,里面是接口。我用到的是它的实现类,在[com.***.service.impl]包下
更疑惑的是早上启动时还不会报这个问题,下午在我启动另一个项目后再此启动这个项目就出现了。
网上说是 <context:component-scan > 包没配好,于是我把报异常的包也加进去,变成
<context:component-scan base-package="com.**.service.impl,com.**.service" resource-pattern="**/*.class"> </context:component-scan>
再次启动就好了。。。
更疑惑的是 我又把包从<context:component-scan > 中给删除了,然后没有报异常。
最大的问题是控制台显示的异常和实际上可能遇到的问题不同。。。。
我猜是myeclipse缓存的问题。。
关于No qualifying bean of type [XXX.XXX] found for dependency 的一次记录的更多相关文章
- spring注入时报错::No qualifying bean of type 'xxx.xxMapper'
做一个小项目,因为有 baseService,所以偷懒就没有写单独的每个xxService接口,直接写的xxServiceImpl,结果在service实现类中注入Mapper的时候,用的 @Auto ...
- maven多模块启动required a bean of type com.xxx.xxx.service that could not be found.
Description: Field testService in com.xxx.xxx.api.controller.TestController required a bean of type ...
- Spring mvc 报错:No qualifying bean of type [java.lang.String] found for dependency:
具体错误: No qualifying bean of type [java.lang.String] found for dependency: expected at least 1 bean w ...
- No qualifying bean of type [com.shyy.web.service.TreeMapper] found for dependency
异常信息: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.sp ...
- Spring Task Scheduler - No qualifying bean of type [org.springframework.scheduling.TaskScheduler] is defined
1. Overview In this article, we are discussing the Springorg.springframework.beans.factory.NoSuchBea ...
- 【Spring】手动获取spring容器对象时,报no qualifying bean of type is defined
手动获取容器对象时,报no qualifying bean of type is defined, 经过调查,发现手动获取的时候,该类所在的包必须经过spring容器初始化. 1.SpringConf ...
- Spring4.14 事务异常 NoUniqueBeanDefinitionException: No qualifying bean of type [....PlatformTransactionManager]
环境为Spring + Spring mvc + mybatis:其中Spring版本为4.1.4 spring配置文件: <?xml version="1.0" encod ...
- 添加事务后 org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type available
今天遇到了一个奇怪的问题 在没添加事务之前 所有的代码都是好的 , 当我添加了事务之后, 代码报错 org.springframework.beans.factory.NoSuchBeanDef ...
- springmvc注入类 NoUniqueBeanDefinitionException: No qualifying bean of type [] is defined: expected single错误
在springmvc中注入服务时用@Service 当有两个实现类时都标明@Service后则会出现异常: nested exception is org.springframework.beans. ...
随机推荐
- Visible Lattice Points SPOJ - VLATTICE 三维+莫比乌斯反演
#include<bits/stdc++.h> #define ll long long using namespace std; ; int vis[maxn]; int mu[maxn ...
- Web前端学习第一天
1.SQL注入攻击的发生 select username, email ,descl from users where id=1; 可能会被伪造成 1 union select password,1, ...
- ssm项目整合shiro
pom.xml <properties> <shiro.version>1.2.2</shiro.version> </properties> < ...
- Alpha阶段个人心得
在一个学期的学习中,我从一个只会一个人打打小规模代码的初学者也变成了一个能参与到团队做项目的“入门码农”,而我们团队从一开始对大型项目的望而生畏无从下手变成细分任务各司其职,也了解并感受到github ...
- Python练习十一
1.写一个程序,提示输入整数X,然后计算从1到X连续整数的和. num = int(input('please the input number:')) sum_num = 0 for i in ra ...
- 10. Firewalls (防火墙 2个)
Netfilter是在标准Linux内核中实现的强大的包过滤器. 用户空间iptables工具用于配置. 它现在支持数据包过滤(无状态或有状态),各种网络地址和端口转换(NAT / NAPT),以及用 ...
- 第六章Django
web应用程序 server端建立socket,不断地accept,当收到客户端连接信号之后,服务端向客户端发送数据,将html网页打开,read出来,并发送至客户端,这样客户端就可以浏览到网页的内容 ...
- Missile Command 导弹指令
发售年份 1980 平台 街机 开发商 雅达利(Atari) 类型 射击 https://www.youtube.com/watch?v=nokIGklnBGY
- DevExpress中GridControl的使用笔记
主要参考链接:DevExpress GridControl控件使用 Content [Level 1:基本](#Level 1:基本) [Level 2:列名](#Level 2:列名) [Level ...
- html 出现粒子线条,鼠标移动会以鼠标为中心吸附的特效之canvas-nest.js插件
我在网上看到一个很炫酷,很有趣的特效,网页上会有很多移动的粒子和线条,鼠标经过时会以鼠标为中心吸附过来,如果时间够久,会形成一个类似震动的.带辐条的车轮子的东西. 网上搜了一下,源码是github里面 ...