异常开始于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 的一次记录的更多相关文章

  1. spring注入时报错::No qualifying bean of type 'xxx.xxMapper'

    做一个小项目,因为有 baseService,所以偷懒就没有写单独的每个xxService接口,直接写的xxServiceImpl,结果在service实现类中注入Mapper的时候,用的 @Auto ...

  2. 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 ...

  3. 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 ...

  4. 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 ...

  5. 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 ...

  6. 【Spring】手动获取spring容器对象时,报no qualifying bean of type is defined

    手动获取容器对象时,报no qualifying bean of type is defined, 经过调查,发现手动获取的时候,该类所在的包必须经过spring容器初始化. 1.SpringConf ...

  7. Spring4.14 事务异常 NoUniqueBeanDefinitionException: No qualifying bean of type [....PlatformTransactionManager]

    环境为Spring + Spring mvc + mybatis:其中Spring版本为4.1.4 spring配置文件: <?xml version="1.0" encod ...

  8. 添加事务后 org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type available

    今天遇到了一个奇怪的问题   在没添加事务之前  所有的代码都是好的 , 当我添加了事务之后, 代码报错 org.springframework.beans.factory.NoSuchBeanDef ...

  9. springmvc注入类 NoUniqueBeanDefinitionException: No qualifying bean of type [] is defined: expected single错误

    在springmvc中注入服务时用@Service 当有两个实现类时都标明@Service后则会出现异常: nested exception is org.springframework.beans. ...

随机推荐

  1. vba data to input tool

    public Sub InserDb() dim maxrow as integer dim maxcol as integer dim ddl as string dim recode as str ...

  2. JS写法 数值与字符串的相互转换 取字符中的一部分显示 正则表达规则

    http://www.imooc.com/article/15885 正则表达规则 <script type="text/javascript"> </scrip ...

  3. 学习笔记TF064:TensorFlow Kubernetes

    AlphaGo,每个实验1000个节点,每个节点4个GPU,4000 GPU.Siri,每个实验2个节点,8个GPU.AI研究,依赖海量数据计算,离性能计算资源.更大集群运行模型,把周级训练时间缩短到 ...

  4. MATLAB EMD 初始

    帮小伙伴研究这个  随便写写 安装参考https://blog.csdn.net/qrlhl/article/details/52213135 函数学习: disp函数 : 1.disp函数:显示文本 ...

  5. JSP+javaBean:简易投票网页练习

    一.项目目标 session作用域中如果不及时清理一些对象,在一定久的时间或相当数量的请求后,造成session中大量对象堆积,这将严重影响服务器的性能. 在本实例中,通过写一个jsp与javaBea ...

  6. Java中反射的实现方式

    所谓反射,是指在运行时状态中,获取类中的属性和方法,以及调用其中的方法的一种机制.这种机制的作用在于获取运行时才知道的类(Class)及其中的属性(Field).方法(Method)以及调用其中的方法 ...

  7. Linux内核笔记:内存管理

    逻辑地址由16位segment selector和offset组成 根据segment selector到GDT或LDT中去查找segment descriptor 32位base,20位limit, ...

  8. linux路由

    https://www.cnblogs.com/luckyall/p/6418965.html https://www.cnblogs.com/dapaitou2006/p/6564622.html一 ...

  9. Jquery 一个页面多个倒计时 实现

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  10. Java 序列化 返序列化

    原文: http://www.cnblogs.com/xdp-gacl/p/3777987.html   一.序列化和反序列化的概念 把对象转换为字节序列的过程称为对象的序列化. 把字节序列恢复为对象 ...