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://www.cnblogs.com/waterystone/p/6214212.html

【转】IntelliJ Idea取消Could not autowire. No beans of 'xxxx' type found的错误提示的更多相关文章

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

    1.问题描述 在Idea的spring工程里,经常会遇到Could not autowire. No beans of 'xxxx' type found的错误提示.但程序的编译和运行都是没有问题的, ...

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

    IntelliJ Idea 解决 Could not autowire. No beans of 'xxxx' type found 的错误提示哈,在使用 @Autowired 时,今天又遇一坑,这俩 ...

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

    本文转自:http://blog.csdn.net/u012453843/article/details/54906905 1.问题描述 在Idea的spring工程里,经常会遇到Could not ...

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

    问题描述 在idea中进行开发时,经常会遇见Could not autowire. No beans of 'xxxx' type found的错误提示,这样的是不影响程序编译和运行的,但是看起来会很 ...

  5. Could not autowire. No beans of 'xxxx' type found的错误

    在Idea的spring工程里,经常会遇到Could not autowire. No beans of 'xxxx' type found的错误提示.但程序的编译和运行都是没有问题的,这个错误提示并 ...

  6. IntelliJ Idea设置Could not autowire. No beans of 'xxx' type found

    1.问题描述 在Idea的spring工程里,经常会遇到Could not autowire. No beans of ‘xxxx’ type found的错误提示.但程序的编译和运行都是没有问题的, ...

  7. SpringBoot学习- 7、问题Could not autowire. No beans of 'xxxx' type found处理

    SpringBoot学习足迹 这个问题网上有好多同学都提到这个问题,代码可以运行,但是就是有红线,强迫症不能忍 自己试验下 1.增加一个final编译一下,再删掉就不会出红线了 public clas ...

  8. Could not autowire. No beans of 'TbItemMapper' type found. less... (Ctrl+F1) Checks autowiring prob

    Intellij Idea开发工具在@Autowired或者@Resource注入XxxMapper接口时报如下错误: Could not autowire. No beans of 'TbItemM ...

  9. Could not autowire. No beans of 'TbAssetsMapper' type found. less... (Ctrl+F1) Inspection info:Checks autowiring problems in a bean class.

    报错:Could not autowire. No beans of 'TbAssetsMapper' type found. less... (Ctrl+F1) Inspection info:Ch ...

随机推荐

  1. idea maven项目依赖项有红色波浪线

    在maven面板选中所有报错的maven项目,右键选择移除(remove),之后重新添加.

  2. thinkphp对mysql的CURD操作

    利用thinkphp(3.2.3)来操作数据库,首先要连接数据库.我们需要对某数据库写一个配置文件,thinkphp会根据该配置文件自动连接上数据库.而model文件就不用自定义,内置的即可解决问题. ...

  3. js 线程和进程的关系

    进程(process)和线程(thread)是操作系统的基本概念 1.计算机的核心是CPU,它承担了所有的计算任务 2.单个CPU一次只能运行一个任务 3.进程它代表CPU所能处理的单个任务.任一时刻 ...

  4. 7. Reverse Integer 反转整数

    [抄题]: 将一个整数中的数字进行颠倒,当颠倒后的整数溢出时,返回 0 (标记为 32 位整数).   样例 给定 x = 123,返回 321 给定 x = -123,返回 -321 [暴力解法]: ...

  5. Docker学习笔记_安装和使用Zookeeper

    一.准备 1.宿主机OS:Win10 64位 2.虚拟机OS:Ubuntu18.04 3.账号:docker 二.安装 1.搜索镜像                                  ...

  6. 获取表中唯一字符串uuid,可用于随机文件名

    在mysql数据库中,可以使用uuid()语句来生成一个UUID:例如:mysql> select uuid();+--------------------------------------+ ...

  7. ThinkPHP5权限控制

    我在用ThinkPHP5做开发的时候发现,它没有权限类,自己写太麻烦,于是就想到了把TP3里面的权限类拿来修改使用,结果这种方法是可行的,下面记录附上修改后的Auth.php权限类 <?php ...

  8. javascript总结9:JavaScript三目运算符

    1 三元表达式: 表达式?结果1:结果2: 如果表达式结果为true,执行结果1,如果表达式结果为false,执行结果2. 可以理解为if else  的另外一种写法. 例: var m = 10; ...

  9. Java WEB中的servlet

    1.什么是servlet 2.servlet实现的过程 3.servlet的生命周期 4.servlet实现类及实现方法 什么是servlet Servlet 是在服务器上运行的小程序.这个词是在 J ...

  10. 设计模式11: Flyweight 享元模式(结构型模式)

    Flyweight 享元模式(结构型模式) 面向对象的代价 面向对象很好的解决了系统抽象性的问题,同时在大多数情况下也不会损及系统的性能.但是,在某些特殊应用中,由于对象的数量太大,采用面向对象会给系 ...