Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.baomidou.mybatisplus.core.injector.ISqlInjector' available: expected single matching bean but found 2: mpjSqlInjectorOnMiss,sqlInjector
因为 MybatisPlusJoinAutoConfiguration.mpjSqlInjector 和 MybatisPlusJoinAutoConfiguration.mpjSqlInjectorOnMiss 会创建 ISqlInjector 的实例, 然而如果业务代码也需要创建 ISqlInjector 的时间, 就会导致存在多个 bean: