Could not autowire. No beans of ‘BookMapper’ type found.
解决方法:
第一种:在IDEA中设置一下,
Settings - Editor - Inspections - Spring - Spring Core - Code - Autowiring for Bean Class - disable 把勾去掉即可,如下图:
第二种:
在BookMapper类内添加注解@Component
第三种:将@Autowired注解改为@Autowired注解
第四种,在在BookMapper类内添加注解@Repository
问题解决!!!
Could not autowire. No beans of ‘BookMapper‘ type found.
最新推荐文章于 2024-05-01 11:37:59 发布