IntelliJ Idea取消Could not autowire. No beans of 'xxxx' type found的错误提示
2019独角兽企业重金招聘Python工程师标准>>>
1.问题描述
在Idea的spring工程里,经常会遇到Could not autowire. No beans of 'xxxx' type found的错误提示。但程序的编译和运行都是没有问题的,这个错误提示并不会产生影响。但红色的错误提示在有些有强迫症的程序员眼里,多多少少有些不太舒服。
2. 原因
spring auto scan配置,在编辑情况下,无法找不到对应的bean,于是提示找不到对应bean的错误。常见于mybatis的mapper,如下:
<!-- mapper scanner configurer -->
<bean id="mapperScannerConfig" class="org.mybatis.spring.mapper.MapperScannerConfigurer"><property name="basePackage" value="com.adu.spring_test.mybatis.dao" /><property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
</bean>
3. 解决方案
降低Autowired检测的级别,将Severity的级别由之前的error改成warning或其它可以忽略的级别。
转载于:https://my.oschina.net/thinwonton/blog/961893
IntelliJ Idea取消Could not autowire. No beans of 'xxxx' type found的错误提示相关推荐
- IntelliJ Idea解决Could not autowire. No beans of 'xxxx' type found的错误提示
解决方法:在Mapper层加入@Repository
- Could not autowire. No beans of 'xxxx' type found的错误提示
spring 集成mybatis 找不到 beans 查了很多网页,解决办法是: 在PersonMapper 上加 @Repository package zengmiaogen.csdn.cn.my ...
- IDEA 报 「Could not autowire. No beans of ‘UserMapper‘ type found」错误解决方案
IDEA 报 「Could not autowire. No beans of 'UserMapper' type found」错误解决方案 参考文章: (1)IDEA 报 「Could not au ...
- 解决IDEA : Could not autowire. No beans of ‘xxxx‘ type found
错误信息 Could not autowire. No beans of 'xxxx' type found 导致原因及其解决办法 三种报错原因: 第一种:IDEA工具自身的缺陷,问题出在 sprin ...
- IntelliJ Idea取消Colud not autowire.No
转载:https://www.cnblogs.com/waterystone/p/6214212.html 1.问题描述 在Idea的spring工程里,经常会遇到Could not autowire ...
- Java--使用@Autowired报错Could not autowire. No beans of ‘XX‘ type found.
使用@Autowired时报错如下: Could not autowire. No beans of 'XXXX' type found. 1.检查下导入对象类的路径:注入的时候,导入的对象类路径不对 ...
- Could not autowire. No beans of ‘UserMapper‘ type found.
报红内容: 在这里可以发现userMapper处爆红,显示Could not autowire. No beans of 'UserMapper' type found.,但是在程序运行过程中并未影响 ...
- 使用 @Resource或@Autowire时 Idea报错Could not autowire. No beans of 'xxxService' type found. more..出现红色波浪线
原博客:https://blog.csdn.net/qq_36802726/article/details/84026031 错误: 使用注解@Resource或者@Autowire intelli ...
- SpringBoot报错:Could not autowire. No beans of ‘DiscussantMapper‘ type found
SpringBoot报错:Could not autowire. No beans of 'DiscussantMapper' type found 一.资源 @Mapper和@Repository注 ...
最新文章
- 20145223 《信息安全系统设计基础》课程总结
- CloudStack 制作window模板
- matlab贝塞尔滤波器设计_DSP之窗函数法设计高通滤波器(MATLAB实现)
- springMVC通过ajax传递参数list对象或传递数组对象到后台
- ALV添加文字输入框
- Android SQLite Database的使用模板
- seconds_behind_master监控复制推延的不足及pt-heartbeat改进方法
- 2019牛客暑期多校训练营(第十场)C - Gifted Composer (二分+哈希)
- MySQL(介绍,安装,密码操作,权限表)
- php 邮件收发 (乱码)
- java 中鼠标事件_[Java教程]js中鼠标事件总结
- 使用webpack5模块联邦
- linux 应用程序 死锁,程序死锁了
- 什么是深度卷积神经网络,卷积神经网络怎么学
- 硬盘内部传输速率和外部传输速率的区别
- 二十二、商城 - 商品录入-FastDFS(10)
- 以前不懂事现在只想搞钱,从0-1搭建一个树莓派小车
- Oracle-count加条件计算
- MySQL表级锁之表锁
- postman测试接口成功,实际发请求时失败