版权声明:软妹儿❀
启动SpringBoot项目的时候报错,报错内容如下:
Error starting ApplicationContext. To display the auto-configuration report re-run your application with ‘debug’ enabled.
2019/08/13-16:57:55 [main] ERROR org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter-
APPLICATION FAILED TO START
Description:
Field homeMapper in com.tour.travehome.service.impl.HomeServiceImpl required a bean of type ‘com.tour.travehome.mapper.HomeMaper’ that could not be found.
Action:
Consider defining a bean of type ‘com.tour.travehome.mapper.HomeMaper’ in your configuration.
**解决方法:
在springboot的启动类中加入@MapperScan(“mapper类的路径”)
或者直接在Mapper类上面添加注解@Mapper,建议使用上面那种,不然每个mapper加个注解也挺麻烦的
加上之后再重新启动SpringBoot项目就可以了