当前位置:网站首页>No qualifying bean of type 问题
No qualifying bean of type 问题
2022-07-31 03:19:00 【UlricaQ】
No qualifying bean of type 问题解决思路
解决 No qualifying bean of type 问题,目前遇到过两种导致错误的原因:
- 注解
- 配置(扫描包,nacos,类名等)
1、注解
- 检查controller,service,mapper对应的注解是否正确
- 如:@Controller @Service @Component @Repository
2、配置
1、配置是否使用了nacos,需要配置数据库信息等。
2、扫描包是否用到

或者使用了@MapperScan(value="com.*** ")
注解扩展
- what:代码里的特殊标记
- where:可以放在方法上,也可以放在类上
1、前端代码 链接是如何使用注解的?
- 如果注解放在方法上,链接中写方法的注解即可

- 如果注解放在类上,链接中需要写类+方法的注解

2、注解属性:
- path:指定请求的URL
- (常用)value和path功能一样,都可以加路径,使用value可省略,直接写路径即可
- (常用)method:指定该方法的请求方式
- headers:指定限制请求消息头的条件-
- params:限制请求参数的条件
– key和value值一样
–情况1:只限制传参,不限制参数是具体的什么
–情况2:参数必须一致
3、常用注解
@RequestParam
- 作用:把请求中指定名称的参数给控制器中的形参赋值
- 属性:
–value:参数名称
–required:是否必须填此参数 - 例子

@RequestBody
- 作用:用于获得请求体内容
- 属性:required
- 作用域:异步(异步时会用到)
- 例子

@PathVariable
- 作用:绑定url的占位符

- 优点:restful编程风格
- 原来的方式–每一个路径都要添加根路径

- restful方式:用get、post、put区别开路径
–localhost:8080/user/10 get——这就是表明请求方式为get并带id这个参数的http请求
@RequestHeader:不常用
@CookieValue
- 作用:把指定cookie名称的值传入控制器方法参数
@ModelAttribute
- 作用:修饰方法和参数
- how:该修饰先执行
@SessionAttributes
- 作用:用于多次执行控制器方法间的参数共享
- 属性
–value
–type-存入的数据类型
边栏推荐
- 什么是系统?
- Compile Hudi
- Moxa NPort device flaw could expose critical infrastructure to devastating attack
- Crypto Firms Offer Offer To Theft Hackers: Keep A Little, Give The Rest
- 2022 Nioke Multi-School League Game 4 Solution
- What skills do I need to learn to move from manual testing to automated testing?
- SQL 面试用题(重点)
- 点云DBSCAN聚类(MATLAB,非内置函数)
- Select the smoke test case, and make the first pass for the product package entering QA
- 下载jar包的好地方
猜你喜欢

Crypto Firms Offer Offer To Theft Hackers: Keep A Little, Give The Rest

Is interprofessional examination difficult?Low success rate of "going ashore"?Please accept this practical guide!
![[C language] Preprocessing operation](/img/69/0aef065ae4061edaf0d96b89846bf2.png)
[C language] Preprocessing operation

Mysql 45 study notes (twenty-five) MYSQL guarantees high availability

Detailed explanation of TCP and UDP

LeetCode简单题之找到和最大的长度为 K 的子序列

How to develop a high-quality test case?

TCP详解(一)

Mysql 45讲学习笔记(二十三)MYSQL怎么保证数据不丢

递归查询单表-单表树结构-(自用)
随机推荐
els block to the right
Use of QML
STM32问题合集
QML的使用
LeetCode每日一练 —— 138. 复制带随机指针的链表
[Dynamic programming] Maximum sum of consecutive subarrays
识Flutter 基本组件之showTimePicker 方法
Mysql 45讲学习笔记(二十四)MYSQL主从一致
Web container and IIS --- Middleware penetration method 1
【C语言】表达式求值的一般方法
VS QT——ui不显示新添加成员(控件)||代码无提示
C# remote debugging
Problems that need to be solved in distributed system architecture
刚出道“一战成名”,安全、舒适一个不落
浅识Flutter 基本组件之showDatePicker方法
【C语言】三子棋(经典解法+一览图)
What is SQALE
Getting Started with CefSharp - winform
5. How does the SAP ABAP OData service support the $filter operation
The els block moves the boundary to the right, and accelerates downward.
