IDEA解决"Could not autowire. No beans of 'xxxx' type found"的错误提示

Posted edenchaniy

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了IDEA解决"Could not autowire. No beans of 'xxxx' type found"的错误提示相关的知识,希望对你有一定的参考价值。

使用IDEA开发Spring Boot项目的时候,利用注解的方式整合Mybatis。在运行的时候有可能会出现"Could not autowire. No beans of ‘xxxx‘ type found"的错误提示,这个提示的意思就是没有找到该类型的bean,也就是说创建dao层的实例失败。

这种情况一般是配置注解的时候没有扫描到mapper层,但是有的时候明明路径配置没有问题还是会出现这个问题,这个时候有可能是因为IDEA本身的问题。

解决办法是在mapper层添加注解@Repository

这个问题的原因还不清楚,之后了解清楚后会进行补充...

以上是关于IDEA解决"Could not autowire. No beans of 'xxxx' type found"的错误提示的主要内容,如果未能解决你的问题,请参考以下文章

IDEA解决"Could not autowire. No beans of 'xxxx' type found"的错误提示

IntelliJ idea 报错:Could not autowire,no beans of "XXX" type found

运行项目IDEA报 Could not create the Java Virtual Machine问题解决

IDEA用github提交Could not resolve host: github.com的解决方案

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

解决IDEA报错Could not autowire. There is more than one bean of 'xxx' type