我的问题出在Cache的实现类中getId()没设置返回值。
Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
2021-06-15 00:13:52.942 ERROR 7820 — [ restartedMain] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘empController’: Unsatisfied dependency expressed through field ‘empService’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘empServiceImpl’: Unsatisfied dependency expressed through field ‘empDAO’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘empDAO’ defined in file [E:\workspace\ems_vue\target\classes\com\baizhi\dao\EmpDAO.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 [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.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.core.NestedIOException: Failed to parse mapping resource: ‘file [E:\workspace\ems_vue\target\classes\com\baizhi\mapper\EmpDAOMapper.xml]’; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is ‘file [E:\workspace\ems_vue\target\classes\com\baizhi\mapper\EmpDAOMapper.xml]’. Cause: org.apache.ibatis.logging.LogException: Error creating logger for logger null. Cause: java.lang.reflect.InvocationTargetException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessorAutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643) [spring−beans−5.2.4.RELEASE.jar:5.2.4.RELEASE]atorg.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130) [spring−beans−5.2.4.RELEASE.jar:5.2.4.RELEASE]atorg.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) [spring−beans−5.2.4.RELEASE.jar:5.2.4.RELEASE]atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1422) [spring−beans−5.2.4.RELEASE.jar:5.2.4.RELEASE]atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) [spring−beans−5.2.4.RELEASE.jar:5.2.4.RELEASE]atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) [spring−beans−5.2.4.RELEASE.jar:5.2.4.RELEASE]atorg.springframework.beans.factory.support.AbstractBeanFactory.lambdaAutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1422) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambdaAutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643) [spring−beans−5.2.4.RELEASE.jar:5.2.4.RELEASE]atorg.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130) [spring−beans−5.2.4.RELEASE.jar:5.2.4.RELEASE]atorg.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) [spring−beans−5.2.4.RELEASE.jar:5.2.4.RELEASE]atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1422) [spring−beans−5.2.4.RELEASE.jar:5.2.4.RELEASE]atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) [spring

在尝试整合SpringBoot和Redis时遇到错误:'org.springframework.beans.factory.UnsatisfiedDependencyException'。错误源于Cache的实现类中getId()方法未设置返回值。进一步的堆栈跟踪显示问题可能涉及到依赖注入失败,特别是与'sqlSessionFactory'的配置相关,可能是由于EmpDAOMapper.xml映射文件解析错误导致的日志创建问题。
最低0.47元/天 解锁文章
9900

被折叠的 条评论
为什么被折叠?



