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删除。



猜您在找 Field tTypeMapper in com.atguigu.project.service.imp.projectInfoServiceImpl required a bean of type 'com.atguigu.project.mapper.TTypeMapper' that could not be found. Description: Field ud in com.yjj.service.impl.UserServiceImpl required a bean of type 'com.yjj.dao.UserDao' that could not be found. Action: Consider defining a bean of type 'com.yjj.dao.UserDao' 2. springboot启动报错:Field userMapper in com.service.UserService required a bean of type 'com.dao.UserMapper' that could not be found. Field userService in com.wuji.controller.UserController required a bean of type 'com.wuji.service.UserService' that could not be found Field baseMapper in com.baomidou.mybatisplus.extension.service.impl.ServiceImpl required a single bean, but xx were found: 【错误分析】Field productMapper in org.spring.springboot.service.impl.ProductServiceImpl required a bean of type 'org.spring.springboot.mapper.ProductMapper' that could not be found.报错,找不到mapper的bean。 Java报错: A component required a bean of type 'com.sirifeng.testmybatis.mapper.BookMapper' that could not be found. springcloud 项目搭建遇到的问题及解决-Field restTemplate in com.cloud.ribbon_consumer.project.service.xxxService required a bean of type 'org.springframework.web.client.RestTemplate' that could not be found. SpringCloud报错: "Field discoveryClient in com.controller.DcController required a bean of type 'com.netflix.discovery.DiscoveryClient' that could not be found." 解决:Field xxMapper in xx.service.impl.xxServiceImpl required a bean of type 'xx.mapper.xxMapper'
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM