Could not autowire. No beans of ‘xxxMapper‘ type found.

2023-05-16

Could not autowire. No beans of ‘xxxMapper’ type found.的三种解决办法

出现Could not autowire. No beans of ‘xxxMapper’ type found.的解决办法
问题描述
法一:在Mapper接口文件上添加@Repository注解,代表数据访问

法二:添加@Component注解,相当于写入配置文件<bean id ="" class=""/>

法三:删除@Autowired注解,使用@Resource注解。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Could not autowire. No beans of ‘xxxMapper‘ type found. 的相关文章

随机推荐