SpringBoot找不到Mapper

例如:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-09-30 10:26:31.547 ERROR 49280 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

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

Description:

Field tUserMapper in com.zxh.Service.Impl.UserServiceImpl required a bean of type 'com.zxh.Dao.TUserMapper' that could not be found.


Action:

Consider defining a bean of type 'com.zxh.Dao.TUserMapper' in your configuration.

需要在启动类里面加入

@MapperScan("com.zxh.Dao")

com.zxh.Dao为你项目Mapper接口文件夹路径或者项目路径

我的项目结构 

猜你喜欢

转载自blog.csdn.net/weixin_41788754/article/details/82906268
今日推荐