问题描述
SpringBoot项目启动报错,报错内容:‘com.xxx.mapper.XxxxMapper’ that could not be found

*************************** APPLICATION FAILED TO START


Description:

Field userMapper in com.demo.controller.MemberController required a
bean of type ‘com.demo.mapper.UserMapper’ that could not be found.

Action:

Consider defining a bean of type ‘com.demo.mapper.UserMapper’ in your
configuration.

Process finished with exit code 1

问题原因:未扫描到mapper

解决方式:启动类中添加@MapperScan("com.demo.mapper")
在这里插入图片描述
在这里插入图片描述

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐