Intellij Idea上做 Spring Boot + mybatis项目。
一直提示 Could not Autowire. 虽然不影响工作,但心理抓狂。
Google提出降低 spring 的 Could not autowire 的报警等级。但是治标不治本。 困扰了几天。如下图:

解决办法:在每个mapper接口上添加
@Repository注解,瞬间解决!
本文介绍了一种在使用IntelliJ IDEA进行Spring Boot+MyBatis项目开发过程中遇到的CouldnotAutowire错误,并给出了通过在Mapper接口上添加@Repository注解来解决该问题的方法。
Intellij Idea上做 Spring Boot + mybatis项目。
一直提示 Could not Autowire. 虽然不影响工作,但心理抓狂。
Google提出降低 spring 的 Could not autowire 的报警等级。但是治标不治本。 困扰了几天。如下图:

解决办法:在每个mapper接口上添加
@Repository注解,瞬间解决!
340
451

被折叠的 条评论
为什么被折叠?