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

Intellij Idea开发工具在@Autowired注入XxxMapper接口时报如下错误:

Could not autowire. No beans of ‘XxxMapper’ type found. less… (Ctrl+F1)Checks autowiring problems in a bean class.

解决方法如下,在 Intellij Idea中设置一下:

Settings - Editor - Inspections - Spring - Spring Core - Code - Autowiring for Bean Class - disable(把√去掉)

引用:https://blog.csdn.net/xxw1995823/article/details/78620785

猜你喜欢

转载自blog.csdn.net/menglinjie/article/details/79656874