解决Intellij Idea Spring Boot Mybatis @Autowired报错的问题
来源:互联网 发布:软件测试测试用例 编辑:程序博客网 时间:2024/05/15 23:12
Intellij Idea上做 Spring Boot + mybatis项目。
一直提示 Could not Autowire. 虽然不影响工作,但心理抓狂。
Google提出降低 spring 的 Could not autowire 的报警等级。但是治标不治本。 困扰了几天。如下图:
解决办法:在每个mapper接口上添加
@Repository注解,瞬间解决!
阅读全文