Bootstrap

Could not autowire. No beans of ‘xxxMapper‘ type found.

目录

一、第一种解决办法

二、第二种解决办法


 

在使用IDEA编写代码过程中,你可能会遇到这种情况:

Could not autowire. No beans of 'xxxMapper' type found. 

一般情况下,这种错误是不影响正常编译的。如果非要解决这个问题,

这里我提供2种解决方法供大家参考。

一、第一种解决办法

在Mapper类中加入@Mapper注解(这种方法适用于改动文件比较少的情况,如果需要改动文件比较多,那么中这种方法,明显有点费力。)

 

二、第二种解决办法

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

 修改之后,记得保存,然后这个问题就得以解决。

;