SpringBoot项目启动报错:Field userMapper in com.demo.controller.MemberController required a bean of type ‘c
问题描述:SpringBoot项目启动报错,报错内容:‘com.xxx.mapper.XxxxMapper’ that could not be found*************************** APPLICATION FAILED TO STARTDescription:Field userMapper in com.demo.controller.MemberControlle
·
问题描述:
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")
更多推荐
已为社区贡献4条内容
所有评论(0)