spring boot集成mybatisplus搭建项目,在只有spring boot时访问正常,集成后,启动项目控制台报错如标题:MyBatis: No MyBatis mapper was found in '[xx.mapper]' package. Please check your configuration。
解决方案:把启动类上的扫描mapper的注解@ComponentScan(basePackages = {"com.example.exam.mapper"})改为@MapperScan(basePackages = {"com.example.exam.mapper"})后,重启项目,发现项目正常
本文详细介绍了在SpringBoot项目中集成MyBatisPlus时遇到的扫描Mapper包配置错误问题,并提供了将@ComponentScan修改为@MapperScan后的有效解决方案。
21万+

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



