Expecting a 'Mapping' node but got ''如何解决?

在这里插入图片描述
yml 是通过节点来配置的,这个错误是说节点没有对齐,在报错的地方重新对齐一下就OK啦!
附上一张我的yml文件;

解决前:
在这里插入图片描述
解决后:
在这里插入图片描述
yml的源码

server:
  port: 8001
  
mybatis:
  config-location: classpath:mybatis/mybatis.cfg.xml # mybatis配置文件所在路径
  type-aliases-package: com.yt.springcloud.entity    # 所有饿entity实体类所在包
  mapper-locations:
  - classpath:mybatis/mapper/**/*.xml                # mapper映射文件

spring:
  application:
   name: microservicecloud-dept
  datasource:
   type: com.alibaba.dreid.pool.DruidDataSource       # 当前数据源操作类型
   driver-class-name: org.gjt.mm.mysql.Driver         # mysql驱动包
   url: jdbc:mysql://localhost:3306/cloudDB01         # 数据库名称
   username: root
   password: hannong
   dbcp2:
    min-idle: 5                                      # 数据库连接池的最小维持连接数 
    initial-size: 5                                  # 初始化连接数
    max-total: 5                                     # 最大连接数
    max-wait-millis: 200                             # 等待连接获取的最大超时时间

猜你喜欢

转载自blog.csdn.net/yuanting_/article/details/88172924
今日推荐