SpringBoot报错

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-07-01 23:14:34.933 ERROR 28448 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

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

Description:

Field userMapper in com.suviky.demo.service.impl.UserServiceImpl required a bean of type 'com.suviky.demo.dao.UserMapper' that could not be found.


Action:

Consider defining a bean of type 'com.suviky.demo.dao.UserMapper' in your configuration.


Process finished with exit code 1

解决方法:

SpringBoot整合Mybatis,dao层注解要使用@Mapper, 使用@Repository或者@Component都会报错

或者在入口Application增加@MapperScan("dao包位置")



猜你喜欢

转载自blog.csdn.net/Suviky/article/details/80878777