关于springcloud报错报UnsatisfiedDependencyException的问题

 更新时间:2020年11月14日 10:14:16   作者:Fecker  
这篇文章主要介绍了关于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报错内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!

相关文章

  • java7 新I/O知识点详解

    java7 新I/O知识点详解

    在本篇文章里小编给大家整理的是关于java7 新I/O知识点详解,有需要的朋友们可以学习下。
    2019-11-11
  • 基于java文件上传-原始的Servlet方式

    基于java文件上传-原始的Servlet方式

    下面小编就为大家带来一篇基于java文件上传-原始的Servlet方式。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2017-08-08
  • Mybatis-plus实现主键自增和自动注入时间的示例代码

    Mybatis-plus实现主键自增和自动注入时间的示例代码

    这篇文章主要介绍了Mybatis-plus实现主键自增和自动注入时间的示例代码,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2020-07-07
  • SpringCloud中使用Sentinel实现限流的实战

    SpringCloud中使用Sentinel实现限流的实战

    限流在很多地方都可以使用的到,本篇博客将介绍如何使用SpringCloud中使用Sentinel实现限流,从而达到服务降级的目的,感兴趣的可以了解一下
    2022-01-01
  • Elasticsearch QueryBuilder简单查询实现解析

    Elasticsearch QueryBuilder简单查询实现解析

    这篇文章主要介绍了Elasticsearch QueryBuilder简单查询实现解析,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
    2019-08-08
  • RabbitMQ消费端ACK NACK及重回队列机制详解

    RabbitMQ消费端ACK NACK及重回队列机制详解

    这篇文章主要为大家介绍了RabbitMQ消费端ACK NACK及重回队列机制详解,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪
    2022-12-12
  • 详解Spring基于xml的两种依赖注入方式

    详解Spring基于xml的两种依赖注入方式

    这篇文章主要介绍了详解Spring基于xml的两种依赖注入方式,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2019-12-12
  • java编程实现邮件定时发送的方法

    java编程实现邮件定时发送的方法

    这篇文章主要介绍了java编程实现邮件定时发送的方法,涉及Java基于定时器实现计划任务的相关技巧,具有一定参考借鉴价值,需要的朋友可以参考下
    2015-11-11
  • java  Iterator接口和LIstIterator接口分析

    java Iterator接口和LIstIterator接口分析

    这篇文章主要介绍了java Iterator接口和LIstIterator接口分析的相关资料,需要的朋友可以参考下
    2017-05-05
  • mybatis之增删改查

    mybatis之增删改查

    本篇文章主要介绍了Mybatis实现数据的增删改查实例(CRUD),小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2021-07-07

最新评论