关于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. ...
随机推荐
- c语言实验报告
实验项目:分支结构实验 姓名:熊承启 4.3.1if语句的应用 问题描述: 读入三个分别表示箱子长宽高的整数值,判断并输出该箱子是长方体还是正方体. 程序框图: 程序实现: #include< ...
- springmvc 在非controller下使用@autowired
在SpringMVC框架中,我们经常要使用@Autowired注解注入Service或者Mapper接口,我们也知道,在controller层中注入service接口,在service层中注入其它的s ...
- JavaScript基础之对象属性的检测和枚举
属性检测 对象作为属性的集合,属性又包括自有属性和继承属性: 检测方法: \__ in运算符: \__ var obj = { x:1 } console.log( 'toString' in o ...
- java————数组 简单写出一个管理系统
数组的特点 1, 数组是一块连续的空间,下标描述空间的位置. 2, 下标从0开始,最大下标为数组长度—1.(*.length-1) 3, 数组元素都是变量.(就是每个下标对应的内容).变量的类型 ...
- Ubuntu16.04中如何启用floodlight的一种方式
在 floodlight文件夹下输入 java -jar target/floodlight.jar 启动floodlight控制器,在浏览器窗口输入 http://localhost:8080/ui ...
- vue day5 分页控件 更新 PagedList.mvc 仿
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...
- TEAMWORK1
代码信息 队友:马司雨 队友项目:Prim算法生成最小生成树 codeing地址:这里 博客地址:那里 代码功能审查表 功能模块名称 Prim算法生成最小生成树 审查人 张洋 审查日期 2019.4. ...
- Linux第十节课学习笔记
部署LVM三步: 1.pv:使设备支持LVM: 2.vg:对支持LVM的设备进行整合: 3.lv:将整合的空间进行切割. 每个基本单元PE的大小为4M,分配空间必须是4M的整数倍.可以容量或基本单元个 ...
- 全志A33开发板的安卓控制LED-2-JNI基础
虽然您可以完全使用Java编写应用程序,但有些情况下Java本身并不能满足您的应用程序的需求.当应用程序不能完全用Java编写时,程序员使用JNI编写Java本机方法来处理这些情况. 以下示例说明何时 ...
- JVM GC机制
垃圾收集主要是针对堆和方法区进行. 回收机制: 现在的JVM基本都使用分代回收机制,把堆中内存区域分为新生代,老年代. 新生代: Eden(80%) Survivor0(10%) Survivor1( ...