首页 » java

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

   发表于:java评论 (0)   热度:2822

这个错误就是节点没对齐 在报错的地方重新对齐一下就好了


yml 是通过节点来配置的,这个错误是说节点没有对齐,在报错的地方重新对齐一下就OK啦!

 

解决前:

解决后:

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                             # 等待连接获取的最大超时时间

 

(。・v・。)
喜欢这篇文章吗?欢迎分享到你的微博、QQ群,并关注我们的微博,谢谢支持。