当前使用版本(必填,否则不予处理)
3.4.2
该问题是如何引起的?(确定最新版也有问题再提!!!)
实现IdentifierGenerator,注入Mapper, @Autowired GlobalTableIdMapper tableIdMapper;
重现步骤(如果有就写完整)
@Component public class GlobalIdGenerator implements IdentifierGenerator { @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") @Autowired GlobalTableIdMapper tableIdMapper; =================================== 这样spring boot启动就会失败
报错信息
The dependencies of some of the beans in the application context form a cycle:
userController defined in file [/Users/zanez/IdeaProjects/parent3/business/user/user-web/target/classes/web/user/controller/UserController.class] ↓ ServiceBean:api.user.services.UserService ↓ userServiceImpl (field private db.user.daos.UserDao service.user.services.impls.UserServiceImpl.userDao) ↓ userDaoImpl (field protected com.baomidou.mybatisplus.core.mapper.BaseMapper com.db.config.BaseDao.baseMapper) ↓ userMapper defined in file [/Users/zanez/IdeaProjects/parent3/business/user/user-db/target/classes/db/user/mappers/UserMapper.class] ┌─────┐ | sqlSessionFactory defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class] ↑ ↓ | globalIdGenerator (field db.mysql.mappers.GlobalTableIdMapper com.db.config.GlobalIdGenerator.tableIdMapper) ↑ ↓ | globalTableIdMapper defined in file [/Users/zanez/IdeaProjects/parent3/component/mysql/target/classes/db/mysql/mappers/GlobalTableIdMapper.class]