1.问题描述

在Idea的spring工程里,经常会遇到Could not autowire. No beans of ‘xxxx’ type found的错误提示。但程序的编译和运行都是没有问题的,这个错误提示并不会产生影响。但红色的错误提示在有些有强迫症的程序员眼里,多多少少有些不太舒服。 

2.原因

spring auto scan配置,在编辑情况下,无法找不到对应的bean,于是提示找不到对应bean的错误。常见于mybatis的mapper,如下:

  1.  
    <!-- mapper scanner configurer -->
  2.  
    <bean id="mapperScannerConfig" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
  3.  
    <property name="basePackage" value="com.adu.spring_test.mybatis.dao" />
  4.  
    <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
  5.  
    </bean>

3.解决方案

降低Autowired检测的级别,将Severity的级别由之前的error改成warning或其它可以忽略的级别。 

IntelliJ Idea设置Could not autowire. No beans of 'xxx' type found的更多相关文章

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

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

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

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

  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的错误提示

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

  5. IDEA出现Could not autowire. No beans of 'xxx' type found.解决

    Plan A File → Project Structure... Facets → Spring → 右键删除即可 Plan B File → Settings → Editor → Inspec ...

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

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

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

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

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

  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. ES中文分词器之精确短语匹配(解决了match_phrase匹配不全的问题)

    分词器选择 调研了几种分词器,例如IK分词器,ansj分词器,mmseg分词器,发现IK的分词效果最好.举个例子: 词:<<是的>><span>哈<\span ...

  2. 并查集(Union-Find)

    常见问题: 首先在地图上给你若干个城镇,这些城镇都可以看作点,然后告诉你哪些对城镇之间是有道路直接相连的.最后要解决的是整幅图的连通性问题.比如随意给你两个点,让你判断它们是否连通,或者问你整幅图一共 ...

  3. 深度图像配准(Registration)原理

    机器视觉中,3D相机产生的深度图像(depth image)通常需要配准(registration),以生成配准深度图像(registed depth image).实际上配准的目的就是想让深度图和彩 ...

  4. vlan交换机的端口模式有哪几种

    一 端口类型1 ,Access用户模式2 ,Trunk链路模式3 ,Hybrid模式(跟Trunk很类似但比trunk高级)二 端口介绍2.1 ,Access类型端口:只允许默认vlan的以太网帧,也 ...

  5. Flask--四种请求钩子函数

    请求钩子函数:请求前,请求后需要做的处理 @app.before_first_request-在第一次请求之前执行 @app.before_request-在每一次请求之前执行 @app.after_ ...

  6. ALGO-118_蓝桥杯_算法训练_连续正整数的和

    问题描述 78这个数可以表示为连续正整数的和,++,+++,++. 输入一个正整数 n(<=) 输出 m 行(n有m种表示法),每行是两个正整数a,b,表示a+(a+)+...+b=n. 对于多 ...

  7. PAT 乙级 1076 Wifi密码 (15)

    下面是微博上流传的一张照片:“各位亲爱的同学们,鉴于大家有时需要使用wifi,又怕耽误亲们的学习,现将wifi密码设置为下列数学题答案:A-1:B-2:C-3:D-4:请同学们自己作答,每两日一换.谢 ...

  8. Java性能调优:利用JMC分析性能

    Java性能调优作为大型分布式系统提供高性能服务的必修课,其重要性不言而喻. 好的分析工具能起到事半功倍的效果,利用分析利器JMC.JFR,可以实现性能问题的准确定位. 本文主要阐述如何利用JMC分析 ...

  9. 服务容错保护断路器Hystrix之四:断路器监控(Hystrix Dashboard)-turbine集群监控

    turbine 英[ˈtɜ:baɪn] n. 汽轮机; 涡轮机; 透平机; OK,上文我们看了一个监控单体应用的例子,在实际应用中,我们要监控的应用往往是一个集群,这个时候我们就得采取Turbine集 ...

  10. C# int.ToString()

    C# int.ToString() 格式化数值:有时,我们可能需要将数值以一定的格式来呈现,就需要对数值进行格式化.我们使用格式字符串指定格式.格式字符串采用以下形式:Axx,其中 A 为格式说明符, ...