The error message is as follows:
13:31:17.438 [main] ERROR org.springframework.boot.SpringApplication - Application run failed org.yaml.snakeyaml.scanner.ScannerException: while scanning a simple key in 'reader', line 16, column 1: jsonFile : ^ could not find expected ':' in 'reader', line 17, column 5: #encoding: "GBK" ^ at org.yaml.snakeyaml.scanner.ScannerImpl.stalePossibleSimpleKeys(ScannerImpl.java:484) at org.yaml.snakeyaml.scanner.ScannerImpl.needMoreTokens(ScannerImpl.java:299) at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken (ScannerImpl.java: 247 ) at org.yaml.snakeyaml.parser.ParserImpl $ ParseBlockMappingKey.produce (ParserImpl.java: 602 ) at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:165)
Solution:
In application.yml between key files use a colon: separated, and there is a space between the colon and the value, or to report the above error!
Wrong wording:
encoding:true
Correct writing:
encoding: true
But I gave a space at the beginning, which caused an error.
Error display:
Display correctly:
Similar Posts:
- [Solved] SpringBoot Error: Caused by: org.yaml.snakeyaml.error.YAMLException: java.nio.charset.Malforme
- java.lang.IllegalStateException: Failed to load property source from location ‘classpath:/application-dev.yml’
- Error in configuring static IP in Ubuntu 18.04
- JAVA: scanner Read File encoding Error noSuchElementException
- Springboot startup error yamlexception/malformedinputexception input length = 1
- [Solved] org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token found character ‘@’
- [Solved] IDEA jar Pack Error: java.lang.NoSuchMethodError: org.yaml.snakeyaml.nodes.ScalarNode.getScalarStyle
- How to Solve Error: Scanner class java. Util. NoSuchElementException exception
- Org.yaml.snakeyaml.parser.ParserException: while parsing a block mapping
- Error log: resource leak: ‘xxx’ is never closed (precautions for scanner class)