1. 程式人生 > >org.yaml.snakeyaml.parser.ParserException: while parsing a block mapping

org.yaml.snakeyaml.parser.ParserException: while parsing a block mapping

org.yaml.snakeyaml.parser.ParserException: while parsing a block mapping  

原因:yml檔案格式錯誤,此檔案要求嚴格要求格式

如節點沒有對齊,將Mybatis節點與Spring節點對齊,下面是SpringBoot2.0+Mybatis+Mysql的yml配置檔案

server:
  port: 8080
spring:
  datasource:
           name: daducha
           type: com.alibaba.druid.pool.DruidDataSource
           druid:
                url: jdbc:mysql://127.0.0.1:3306/daducha
                username: root
                password: root
                maxActive: 20
                initialSize: 1
                maxWait: 60000
                minIdle: 1
                timeBetweenEvictionRunsMillis: 60000
                minEvictableIdleTimeMillis: 300000
                testWhileIdle: true
                testOnBorrow: false
                testOnReturn: false
                poolPreparedStatements: true
                maxOpenPreparedStatements: 20
                driver-class-name: com.mysql.jdbc.Driver
mybatis:
  mapper-locations: classpath:mapping/*.xml
  type-aliases-package: com.wuji.entity.po