关于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报错内容请搜索我们以前的文章或继续浏览下面的相关文章希望大家以后多多支持我们!

(0)

相关推荐

  • SpringBoot+Dubbo+Seata分布式事务实战详解

    前言 Seata 是 阿里巴巴开源的分布式事务中间件,以高效并且对业务0侵入的方式,解决微服务场景下面临的分布式事务问题. 事实上,官方在GitHub已经给出了多种环境下的Seata应用示例项目,地址:https://github.com/seata/seata-samples. 为什么笔者要重新写一遍呢,主要原因有两点: 官网代码示例中,依赖太多,分不清哪些有什么作用 Seata相关资料较少,笔者在搭建的过程中,遇到了一些坑,记录一下 一.环境准备 本文涉及软件环境如下: SpringBoot

  • Springcloud seata nacos环境搭建过程图解

    最近学习了一下seata,由于nacos现在也挺火,于是学习了seata注册到nacos,然后集成springcloud 1.nacos配置(自行上官网下载) 将nacos/conf/nacos-mysql.sql导入自己的数据库 2.配置修改nacos/conf/application.properties spring.datasource.platform=mysql db.num=1 db.url.0=jdbc:mysql://127.0.0.1:3306/nacos?character

  • springcloud项目改名的操作方法

    1.原来项目结构 2.子模块改名 2.1rename操作 2.2修改子模块的pom文件 2.3修改父模块pom文件module里面子模块的名称,如果没有modules,就自己加上去 3.父模块改名字 3.1右键中父模块,Rename操作,结果如下图 3.2修改pom文件 3.3修改子模块parent标签父模块的名称(可选) 3.4退出idea 3.5重命名项目文件夹名称 3.6找到项目根目录,删除.idea文件 3.7打开idea重新导入项目即可 3.8由于删除了.idea文件,所有idea存储

  • Springcloud seata分布式事务实现代码解析

    Seata 是一款开源的分布式事务解决方案,致力于提供高性能和简单易用的分布式事务服务.本篇不涉及其原理,只用代码构建项目简单试用一下其回滚的机制. 大致上seata分为TC,TM,RM三大构建成整体.它们之间的包含关系如下.即一(xid主键编码,记录信息)带三(TC,TM,RM) 下面之间构建项目进行测试. 1.下载seata并解压,然后改动配置文件. http://seata.io/zh-cn/blog/download.html官网下载. 解压之后到conf中修改file和registry

  • SpringCloud Gateway自定义filter获取body中的数据为空的问题

    最近在使用SpringCloud Gateway进行网关的开发,我使用的版本是:SpringBoot的2.3.4.RELEASE+SpringCloud的Hoxton.SR8,在自定义过滤器时需要获取ServerHttpRequest中body的数据,发现一直无法获取到数据,经过各种百度.谷歌,再加上自己的实践,终于找到解决方案: 1.首先创建一个全局过滤器把body中的数据缓存起来 package com.cloudpath.gateway.portal.filter; import lomb

  • 详解SpringBoot基于Dubbo和Seata的分布式事务解决方案

    1. 分布式事务初探 一般来说,目前市面上的数据库都支持本地事务,也就是在你的应用程序中,在一个数据库连接下的操作,可以很容易的实现事务的操作. 但是目前,基于SOA的思想,大部分项目都采用微服务架构后,就会出现了跨服务间的事务需求,这就称为分布式事务. 本文假设你已经了解了事务的运行机制,如果你不了解事务,那么我建议先去看下事务相关的文章,再来阅读本文. 1.1 什么是分布式事务 对于传统的单体应用而言,实现本地事务可以依赖Spring的@Transactional注解标识方法,实现事务非常简

  • SpringCloud Alibaba Seata (收藏版)

    一.简介 官网地址: http://seata.io/zh-cn/ 1,概念 Seata是一款开源的分布式事务解决方案,致力于在微服务架构在提供高性能和简单一样的分布式事务服务. 2,处理过程 Transaction ID XID:全局唯一的事务ID Transaction Coordinator(TC) :维护全局和分支事务的状态,驱动全局事务提交或回滚. Transaction Manager™ :定义全局事务的范围:开始全局事务.提交或回滚全局事务. Resource Manager(RM

  • 关于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.springf

  • Springcloud feign传日期类型参数报错的解决方案

    目录 feign传日期类型参数报错 Date类型参数报错 LocalDate类型报错 feign传参问题及传输Date类型参数时差的坑 下面说说两种解决方案 feign传参时候使用@DateTimeFormat注解的坑 feign传日期类型参数报错 Date类型参数报错 在Spring cloud feign接口中传递Date类型参数时报错,报错信息. 场景: 客户端传递一个new Date()的参数,服务端接受的参数和客户端有时间差. 客户端打印格式化的new Date(): 2018-05-

  • Spring整合Mybatis 扫描注解创建Bean报错的解决方案

    目录 Spring整合Mybatis 扫描注解创建Bean报错 springboot+mybatis使用注解方式,出现错误创建dao层bean Spring整合Mybatis 扫描注解创建Bean报错 情景: LZ在整合Spring 和Mybatis 的时候,整合之后部署到tomcat报错 报错信息: Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name

  • 新手常见6种的python报错及解决方法

    此篇文章整理新手编写代码常见的一些错误,有些错误是粗心的错误,但对于新手而已,会折腾很长时间才搞定,所以在此总结下我遇到的一些问题.希望帮助到刚入门的朋友们. 1.NameError变量名错误 报错: >>> print a Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'a' is not defined 解决方案:

  • Python 程序报错崩溃后如何倒回到崩溃的位置(推荐)

    假设我们有一段程序,从 Redis 中读取数据,解析以后提取出里面的 name 字段: import json import redis client = redis.Redis() def read(): while True: data = client.lpop('info') if data: yield json.loads(data) else: break def parse(): for data in self.read(): print(data['name']) if __

  • springBoot集成Elasticsearch 报错 Health check failed的解决

    springBoot集成Elasticsearch 报错 Health check failed 今天集成Elasticsearch 时启动报错 报错信息如下: 2018-11-01 20:52:51.310 INFO [hstao-supersearch,,,] 8528 --- [ main] .s.c.n.e.s.EurekaAutoServiceRegistration : Updating port to 8009 2018-11-01 20:52:51.314 INFO [hstao

  • 关于使用OpenCsv导入大数据量报错的问题

    导入100W的Csv数据,使用OpenCsv解析工具解析Csv,发现报错 报错内容 com.opencsv.exceptions.CsvMalformedLineException: Unterminated quoted field at end of CSV line. Beginning of lost text: [XXXXX...]  at com.opencsv.CSVReader.readNext(CSVReader.java:355) ~[opencsv-4.6.jar!/:na

  • SpringBoot启动yaml报错的解决

    SpringBoot启动yaml报错 报错找不到org.yaml里的一个方法 10:45:54.742 [main] ERROR org.springframework.boot.SpringApplication - Application run failed java.lang.NoSuchMethodError: org.yaml.snakeyaml.nodes.ScalarNode.getScalarStyle()Lorg/yaml/snakeyaml/DumperOptions$Sc

  • mybatis group by substr函数传参报错的解决

    目录 mybatis group by substr传参报错 报异常 原因 使用group by 分组查询返回为null 解决方法 mybatis group by substr传参报错 报异常 ### Cause: java.sql.SQLSyntaxErrorException: ORA-00979: 不是 GROUP BY 表达式 SELECT     SUBSTR( region_code, 1,#{ queryMap.groupCodeLength, jdbcType = INTEGE

  • 解决mysql报错:Data source rejected establishment of connection, message from server: \"Too many connectio

    目录 报错 原因 解决 查看mysql版本 查看当前mysql最大连接数限制 确定连接数不够原因 修改最大连接数 命令设置 修改my.cnf文件 总结 最近在做压力测试嘛,需要逐步增加用户量做验证,每个用户单独创建数据库进行连接,就要不断去创建数据库,这个报错也很容易理解,mysql连接数不够用了 报错 报错信息如下: "SQLState":"08004","vendorCode":1040,"detailMessage":&

随机推荐