异常开始于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. UT源码 105032014098

    package exam1; import java.util.Scanner; public class test01 { static String nextDate(int year,int m ...

  2. java项目---用java重命名文件(1星)

    package Demo; import java.io.File; public class FileRename { public static boolean Rename(String old ...

  3. 关于linux crontab定时操作oracle不执行的问题解决方案

    问题描述:启动定时任务对oracle表进行操作,但是手动执行脚本无问题,定时任务执行无结果不反馈消息 解决方案:以centos7为例吗,首先确定脚本可手动执行,然后检查/var/log/cron下的日 ...

  4. NPOI设置单元格背景色

    NPOI设置单元格背景色在网上有好多例子都是设置为NPOI内置的颜色值 但是想用rgb值来设置背景色,即:通过HSSFPalette类获取颜色值时会抛出异常:Could not Find free c ...

  5. 芯灵思Sinlinx A64开发板Linux内核定时器编程

    开发平台 芯灵思Sinlinx A64 内存: 1GB 存储: 4GB 开发板详细参数 https://m.tb.cn/h.3wMaSKm 开发板交流群 641395230 Linux 内核定时器是内 ...

  6. cookie 就是一些字符串信息

    什么是 Cookie “cookie 是存储于访问者的计算机中的变量.每当同一台计算机通过浏览器请求某个页面时,就会发送这个 cookie.你可以使用JavaScript 来创建和取回cookie 的 ...

  7. linux下目录简介——/proc

    1. /proc目录Linux 内核提供了一种通过 /proc 文件系统,在运行时访问内核内部数据结构.改变内核设置的机制.proc文件系统是一个伪文件系统,它只存在内存当中,而不占用外存空间.它以文 ...

  8. Btrace 拦截构造函数,同名函数

    拦截方法: 1.普通方法  @OnMethod(clazz="", method="") 2.构造函数@OnMethod(claszz="" ...

  9. sum(case when ct.tradeTotal >= 0 then 1 else 0 end)的意思

    String hql = "select new com.ks.admin.report.dto.ReportMonthWithDrawalDto(" + "count( ...

  10. Stripes视图框架实现纯Java代码控制表现层参考文档

    https://blog.csdn.net/boonya/article/details/14101477 Stripes是一个开放源码的Web应用程序框架的基础上的模型 - 视图 - 控制器(MVC ...