1. Error reporting
Two classes inherit com baomidou. mybatisplus. mapper. BaseMapper
Service startup error:
Field baseMapper in com.baomidou.mybatisplus.service.impl.ServiceImpl required a single bean, but 2 were found:
- UserDao: defined in file [D:\projects\test\UserDao.class]
- DepartmentDao: defined in file [D:\projects\test\DepartmentDao.class]
The code is as follows
public interface UserDao extends BaseMapper<UserInfo>{ }
public interface DepartmentDao extends BaseMapper{ }
2. Error reporting reason
Departmentdao did not specify a generic type when inheriting basemapper
3. Solution:
Specifying generics when departmentdao inherits basemapper
public interface DepartmentDao extends BaseMapper<DepartmentInfo>{ }
Read More:
- [Solved] The Bean Validation API is on the classpath but no implementation could be found
- [Solved] SpringBoot Project Startup Error: Field userMapper in com.demo.controller.MemberController required a bean of type ‘c
- Springboot startup error: Field elasticsearchRestTemplate in cn.lili.modules.material.serviceImpl.QrMaterialServiceImpl required a bean of type
- Ureport opens the report files Error: baseMapper [How to Solve]
- How to Solve the Primary Key of mybatisPlus Inserted Data is too Large Issue
- [Solved] Scala error: type mismatch; found : java.util.List[?0] required: java.util.List[B]
- Cannot resolve reference to bean ‘sqlSessionFactory‘ while setting bean property ‘sqlSessionFactory‘
- [Solved] Rabbitmq injection failed, bean creation failed, error creating bean with name ‘rabbitconnectionfactory’‘
- Mybatis single parameter pass in exception (How to Fix)
- Spring Project Error: Error creating bean with name [How to Solve]
- Error creating bean with name [How to Solve]
- [Solved] Springboot Error: Error creating bean with name ‘xxxController‘
- [Solved] Error creating bean with name ‘fileVisitController‘ defined in file
- Java uses single thread pool to realize multi thread sequential execution (non alternating, non synchronous)
- [Solved] In case of “transactionmanager” while setting bean property “transactionmanager” error
- [Solved] Error creating bean with name ‘accountService‘: Unsatisfied dependency expressed through field
- [Solved] org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name
- [Solved] Spring AOP Error creating bean with name
- [Solved] Consider defining a bean of type ‘org.springframework.data.redis.core.RedisTemplate‘ in your configu
- [Solved] Springboot error: Could Not Found xxmapper