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的错误提示相关推荐

  1. IntelliJ Idea解决Could not autowire. No beans of 'xxxx' type found的错误提示

    解决方法:在Mapper层加入@Repository

  2. Could not autowire. No beans of 'xxxx' type found的错误提示

    spring 集成mybatis 找不到 beans 查了很多网页,解决办法是: 在PersonMapper 上加 @Repository package zengmiaogen.csdn.cn.my ...

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

  4. 解决IDEA : Could not autowire. No beans of ‘xxxx‘ type found

    错误信息 Could not autowire. No beans of 'xxxx' type found 导致原因及其解决办法 三种报错原因: 第一种:IDEA工具自身的缺陷,问题出在 sprin ...

  5. IntelliJ Idea取消Colud not autowire.No

    转载:https://www.cnblogs.com/waterystone/p/6214212.html 1.问题描述 在Idea的spring工程里,经常会遇到Could not autowire ...

  6. Java--使用@Autowired报错Could not autowire. No beans of ‘XX‘ type found.

    使用@Autowired时报错如下: Could not autowire. No beans of 'XXXX' type found. 1.检查下导入对象类的路径:注入的时候,导入的对象类路径不对 ...

  7. Could not autowire. No beans of ‘UserMapper‘ type found.

    报红内容: 在这里可以发现userMapper处爆红,显示Could not autowire. No beans of 'UserMapper' type found.,但是在程序运行过程中并未影响 ...

  8. 使用 @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 ...

  9. SpringBoot报错:Could not autowire. No beans of ‘DiscussantMapper‘ type found

    SpringBoot报错:Could not autowire. No beans of 'DiscussantMapper' type found 一.资源 @Mapper和@Repository注 ...

最新文章

  1. 20145223 《信息安全系统设计基础》课程总结
  2. CloudStack 制作window模板
  3. matlab贝塞尔滤波器设计_DSP之窗函数法设计高通滤波器(MATLAB实现)
  4. springMVC通过ajax传递参数list对象或传递数组对象到后台
  5. ALV添加文字输入框
  6. Android SQLite Database的使用模板
  7. seconds_behind_master监控复制推延的不足及pt-heartbeat改进方法
  8. 2019牛客暑期多校训练营(第十场)C - Gifted Composer (二分+哈希)
  9. MySQL(介绍,安装,密码操作,权限表)
  10. php 邮件收发 (乱码)
  11. java 中鼠标事件_[Java教程]js中鼠标事件总结
  12. 使用webpack5模块联邦
  13. linux 应用程序 死锁,程序死锁了
  14. 什么是深度卷积神经网络,卷积神经网络怎么学
  15. 硬盘内部传输速率和外部传输速率的区别
  16. 二十二、商城 - 商品录入-FastDFS(10)
  17. 以前不懂事现在只想搞钱,从0-1搭建一个树莓派小车
  18. Oracle-count加条件计算
  19. MySQL表级锁之表锁
  20. postman测试接口成功,实际发请求时失败

热门文章

  1. [网络收集]LINUX磁盘挂载mount和共享
  2. Linux开机过程(转)
  3. Reddit大热,伯克利PPT带你丝滑入门机器学习:知识点全面覆盖,笔记可搭配食用...
  4. 肖健雄的无人车公司AutoX,现在要在美国配送生鲜了
  5. Hinton反思新作:我说反向传播不好,但还是没谁能颠覆它
  6. 欧空局2018机器学习系列课程发布:从概念到实践(视频+PPT)
  7. 马斯克自曝特斯拉渣产能原因:我错了,过分信任自动化机器人
  8. let和const注意点
  9. Linux就该这么学-第三课
  10. andorid actionBar