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