Field adminMapper in com.course.service.impl.AdminServiceImpl required a bean of type 'com.course.mapper.AdminMapper' that could not be found


Field adminMapper in com.course.service.impl.AdminServiceImpl required a bean of type 'com.course.mapper.AdminMapper' that could not be found.

mybatis-plus版本由3.1.2升级至3.4.0后,重新运行就报了错了

2021-10-30 16:47:03.148 ERROR 17576 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   : 
***************************
APPLICATION FAILED TO START
***************************
Description:

Field adminMapper in com.course.service.impl.AdminServiceImpl required a bean of type 'com.course.mapper.AdminMapper' that could not be found.

Action:
Consider defining a bean of type 'com.course.mapper.AdminMapper' in your configuration.
Process finished with exit code 0

分析一下: adminMapper是列表中最先的一个mapper, 推测 @Mapper注解失效 ,尝试使用@MapperScan注解,发现正常运行了(PS,加了@MapperScan,@Mapper就没必要了)

@MapperScan("com.course.mapper")


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM