Field adminMapper in com.course.service.impl.AdminServiceImpl required a bean of type ‘com.course.mapper.AdminMapper’ that could not be found.
After upgrading mybatis-plus version from 3.1.2 to 3.4.0, re-running it reported an error
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
Analysis: adminmapper is the first mapper in the list. It is speculated that the @mapper annotation is invalid. Try to use the @mapperscan annotation and find that it is running normally (PS, add @mapperscan, and @mapper is not necessary)
@MapperScan("com.course.mapper")
Similar Posts:
- Container Cannot Find bean, Field usersMapper in com.imooc.impl.UserServiceImpl required a bean of type ‘com.imooc.mapper.UsersMapper’ that could not be found.
- Two ways to implement Spring Boot’s scanmapper interface class
- nested exception is org.apache.ibatis.binding.BindingException: Invalid boun
- SpringBoot+Mybatis-plus multi-module project startup Error: xxxmapper or basemapper cannot be found
- Springboot import JPA Error: a bean named ‘entityManagerFactory’ that could not be found
- org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘com.southwind.mmall002.service.Impl.ProductCategoryServiceImplTest’:
- Springboot + Maven multi module project startup Error: XxxService cannot be found
- Error: no bean named xxxxx available [How to Solve]
- Spring cloud uses feignclient to start and report an error
- [Solved] SpringbootExpection 1: Error creating bean with name ‘xxxImpl’: Unsatisfied dependency expressed through field