Caused by: org.yaml.snakeyaml.parser.ParserException: while parsing MappingNode in 'reader', line 4

Caused by: org.yaml.snakeyaml.parser.ParserException: while parsing MappingNode

Caused by: org.yaml.snakeyaml.parser.ParserException: while parsing MappingNode
 in 'reader', line 4, column 3:
      instance:
      ^
Duplicate key: client
 in 'reader', line 12, column 86:
     ... .hostname}:${server.port}/eureka
                                         ^

maven 项目加载配置文件报错:
这种类型是因为配置文件中有重复节点导致,错误的配置文件如下:

server:
  port: 8761
eureka:
  instance:
    hostname: localhost
  client:
    healthcheck:
      enabled: true
  client:
    register-with-eureka: false
    fetch-registry: false
    service-url.defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka

文件中 client 重复,删掉多余的那个 client 即可

你可能感兴趣的:(错误集锦,springboot,Maven,yml,springboot)