关于springcloud报错报UnsatisfiedDependencyException的问题
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-11-14 00:38:14.164 ERROR 1022 --- [ restartedMain] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'paymentController': Unsatisfied dependency expressed through field 'paymentService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'paymentServiceImpl': Unsatisfied dependency expressed through field 'paymentDao'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'paymentDao' defined in file [/Users/caoliu/Idea-workspace/springcloud/springcloud-privoder-payment-8001/target/classes/org/fecker/springcloud/dao/PaymentDao.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 [/Users/caoliu/Idea-workspace/springcloud/springcloud-privoder-payment-8001/target/classes/mybatis/mybatis-config.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.NullPointerException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'XXXXXX': Unsatisfied dependency expressed through
我的报错是因为application.yml文件里mapper-locations配置报错
错误:
#1.配置mapper文件放在resource下的mapper中
mapper-locations: classpath:mybatis/*.xml
正确:
#1.配置mapper文件放在resource下的mapper中
mapper-locations: classpath:mybatis/mapper.xml
到此这篇关于关于springcloud报错报UnsatisfiedDependencyException的问题的文章就介绍到这了,更多相关springcloud报错内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!
相关文章
解决异常FileNotFoundException:class path resource找不到资源文件的问题
今天小编就为大家分享一篇关于解决异常FileNotFoundException:class path resource找不到资源文件的问题,小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,需要的朋友一起跟随小编来看看吧2018-12-12SpringCloud Gateway自定义filter获取body中的数据为空的问题
这篇文章主要介绍了SpringCloud Gateway自定义filter获取body中的数据为空,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下2020-10-10springboot 在xml里读取yml的配置信息的示例代码
这篇文章主要介绍了springboot 在xml里读取yml的配置信息的示例代码,代码简单易懂,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下2020-09-09java面试LruCache 和 LinkedHashMap及算法实现
这篇文章主要为大家介绍了java面试LruCache 和 LinkedHashMap及算法实现示例详解,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪2023-02-02
最新评论