Full Error:
WARN 7612 — [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘processBusinessController’: Unsatisfied dependency expressed through field ‘userService’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘userService’: Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘userMapper’ defined in file [F:code ariacs5g ariacs5g_src ariacs5g-parent ariacs5g-power-parent2 ariacs5g-host-service2 argetclassescom ariacshostmapperUserMapper.class]: 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 java.lang.NoClassDefFoundError: org/mybatis/logging/LoggerFactory 2020-12-25 21:55:07.728 INFO 7612 — [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2020-12-25 21:55:07.737 INFO 7612 — [ main] ConditionEvaluationReportLoggingListener : Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled. 2020-12-25 21:55:07.757 ERROR 7612 — [ main] o.s.boot.SpringApplication : Application run failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘processBusinessController’: Unsatisfied dependency expressed through field ‘userService’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘userService’: Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘userMapper’ defined in file [F:code ariacs5g ariacs5g_src ariacs5g-parent ariacs5g-power-parent2 ariacs5g-host-service2 argetclassescom ariacshostmapperUserMapper.class]: 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 java.lang.NoClassDefFoundError: org/mybatis/logging/LoggerFactory at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessorKaTeX parse error: Undefined control sequence: \[ at position 78: …sor.java:598) ~\̲[̲spring-beans-5.…doGetBeanKaTeX parse error: Undefined control sequence: \[ at position 34: …ory.java:321) ~\̲[̲spring-beans-5.…doGetBeanKaTeX parse error: Undefined control sequence: \[ at position 34: …ory.java:321) ~\̲[̲spring-beans-5.…AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:595) ~[spring-beans-5.1.18.RELEASE.jar:5.1.18.RELEASE] … 19 common frames omitted Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘userMapper’ defined in file [F:code ariacs5g ariacs5g_src ariacs5g-parent ariacs5g-power-parent2 ariacs5g-host-service2 argetclassescom ariacshostmapperUserMapper.class]: 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 java.lang.NoClassDefFoundError: org/mybatis/logging/LoggerFactory at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1506) ~[spring-beans-5.1.18.RELEASE.jar:5.1.18.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1386) ~[spring-beans-5.1.18.RELEASE.jar:5.1.18.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:591) ~[spring-beans-5.1.18.RELEASE.jar:5.1.18.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:514) ~[spring-beans-5.1.18.RELEASE.jar:5.1.18.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBeanKaTeX parse error: Undefined control sequence: \[ at position 34: …ory.java:321) ~\̲[̲spring-beans-5.…ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:637) ~[spring-context-5.1.18.RELEASE.jar:5.1.18.RELEASE] at org.springframework.beans.factory.annotation.InjectionMetadataKaTeX parse error: Undefined control sequence: \[ at position 53: …ata.java:180) ~\̲[̲spring-beans-5.…doGetBeanKaTeX parse error: Undefined control sequence: \[ at position 34: …ory.java:321) ~\̲[̲spring-beans-5.…E n h a n c e r B y S p r i n g C G L I B EnhancerBySpringCGLIBEnhancerBySpringCGLIB602 d 46 a 8. C G L I B 602d46a8.CGLIB602d46a8.CGLIBsqlSessionFactoryKaTeX parse error: Undefined control sequence: \[ at position 17: …(<generated>) ~\̲[̲mybatis-plus-bo…E n h a n c e r B y S p r i n g C G L I B EnhancerBySpringCGLIBEnhancerBySpringCGLIB602 d 46 a 8 602d46a8602d46a8F a s t C l a s s B y S p r i n g C G L I B FastClassBySpringCGLIBFastClassBySpringCGLIBKaTeX parse error: Undefined control sequence: \[ at position 31: …(<generated>) ~\̲[̲mybatis-plus-bo…BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363) ~[spring-context-5.1.18.RELEASE.jar:5.1.18.RELEASE] at com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration E n h a n c e r B y S p r i n g C G L I B EnhancerBySpringCGLIB EnhancerBySpringCGLIB 602d46a8.sqlSessionFactory() ~[mybatis-plus-boot-starter-3.4.1.jar:3.4.1] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_152] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_152] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_152] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_152] at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.1.18.RELEASE.jar:5.1.18.RELEASE] … 58 common frames omitted Caused by: java.lang.ClassNotFoundException: org.mybatis.logging.LoggerFactory at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_152] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_152] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338) ~[na:1.8.0_152] at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_152] … 70 common frames omitted
Solution: The introduction of both Mybatis and Mybatis-plus into the dependency will cause a conflict, either one. In addition to noticing if there is a conflict in the pom file of this module, we also need to see if the parent module of this module has already introduced the mybaits dependency and you later introduce the Mybatis-plus module in this module, causing a conflict. This scenario is more insidious and not easy to detect.