关于SpringMVC未找到类[No qualifying bean of type [...]is defined]问题
首先,不要慌,出现这个问题肯定是某一个配置注解没写上。。
无非就几个地方:
1.控制层是否添加@Controller or 需要pring管理的类是否添加@Component
2.DAO层是否添加@Repository
3.Service层是否添加@Service 不确定的情况下可以@Service("BeanName") 是否引用DAO层的时候未添加@Resource (我喜欢用 @Resource注解在字段上,且这个注解是属于J2EE的,减少了与spring的耦合。最重要的这样代码看起就比较优雅。)
4.就是Controller层是否引用@Autowired
不过第四条出错信息不是此标题描述的,只是检查下是否也忘记引用。
关于SpringMVC未找到类[No qualifying bean of type [...]is defined]问题的更多相关文章
- 【Spring】手动获取spring容器对象时,报no qualifying bean of type is defined
手动获取容器对象时,报no qualifying bean of type is defined, 经过调查,发现手动获取的时候,该类所在的包必须经过spring容器初始化. 1.SpringConf ...
- springmvc注入类 NoUniqueBeanDefinitionException: No qualifying bean of type [] is defined: expected single错误
在springmvc中注入服务时用@Service 当有两个实现类时都标明@Service后则会出现异常: nested exception is org.springframework.beans. ...
- 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 ...
- 无法自动装配。未找到 ‘xxxx’ 类型的 Bean。
无法自动装配.未找到 'xxxx' 类型的 Bean. 1.解决办法 打开设置,找到编辑器->检查.把"自动装配Bean类",取消勾选,点击应用.确定.
- 使用springmvc的时候报错NoSuchBeanDefinitionException: No qualifying bean of type
NoSuchBeanDefinitionException: No qualifying bean of type 其实我至今都不知道错误的根源在哪里,<context:component-sc ...
- 关于No qualifying bean of type [XXX.XXX] found for dependency 的一次记录
异常开始于spring+springmvc+mybatis 注解配置,启动tomcat服务器出现No qualifying bean of type [com.***.service] found f ...
- NoSuchBeanDefinitionException:No qualifying bean of type found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency.
报错如下: NoSuchBeanDefinitionException:No qualifying bean of type found for dependency: expected at l ...
- [zhuanzai]Bean对象注入失败 .NoSuchBeanDefinitionException: No qualifying bean of type..
nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying b ...
- 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 ...
随机推荐
- 聊聊多线程那一些事儿(task)之 三 异步取消和异步方法
hello,咋们又见面啦,通过前面两篇文章的介绍,对task的创建.运行.阻塞.同步.延续操作等都有了很好的认识和使用,结合实际的场景介绍,这样一来在实际的工作中也能够解决很大一部分的关于多线程的业务 ...
- 【温故知新】Java web 开发(二)Servlet 和 简单JSP
系列一介绍了新建一个 web 项目的基本步骤,系列二就准备介绍下基本的 jsp 和 servlet 使用. (关于jsp的编译指令.动作指令.内置对象不在本文讨论范围之内) 1. 首先,在 pom. ...
- Word List 1 part 1
inter- 在....之间 intermediate adj. 中间的 pro- 向前,在前;很多;赞同;亲... proportion n. 比例;部分 prim- 第一,主要的 prime ad ...
- HDU4352 XHXJ's LIS 题解 数位DP
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4352 题目大意: 求区间 \([L,R]\) 范围内最长上升子序列(Longest increasin ...
- 1026 程序运行时间 (15 分)C语言
题目描述 要获得一个C语言程序的运行时间,常用的方法是调用头文件time.h,其中提供了clock()函数,可以捕捉从程序开始运行到clock()被调用时所耗费的时间.这个时间单位是clock tic ...
- nodejs监听服务端口并且代理请求与静态资源
var express = require('express'); const proxy = require('http-proxy-middleware'); const app = expres ...
- shell 概览
shell能做什么: 1. 自动化批量系统初始化程序(update,软件安装,时区设置,安全策略...) 2. 自动化批量软件部署程序(LAMP,LNMP,Tomcat,LVS,Nginx) 3. 管 ...
- DNS自述:我是如何为域名找到家的
对于互联网一代的我们,一出生就学会使用电脑.当我们对着浏览器地址栏输入www.baidu.com的时候,百度的首页就出现在面前.但你可曾想过,为什么我们输入www.baidu.com就可以弹出百度首页 ...
- GDAl C++ 创建Shp
用于GDAL,C++开发环境测试. #include <iostream> #include "gdal_priv.h" #include "ogrsf_fr ...
- 数据库的SQL基本用法 创建 删除 查询 修改
1.说明:创建数据库CREATE DATABASE database-name 2.说明:删除数据库drop database dbname 3.说明:备份sql server--- 创建 备份数据的 ...