Project scenario:
Using springboot to build a personal blog system
reference video: reference video link
Problem Description:
Error reported:
20:40:41.091 [restartedMain] ERROR org.springframework.boot.SpringApplication - Application run failed
org.yaml.snakeyaml.error.YAMLException: java.nio.charset.MalformedInputException: Input length = 1
at org.yaml.snakeyaml.reader.StreamReader.update(StreamReader.java:218)
at org.yaml.snakeyaml.reader.StreamReader.ensureEnoughData(StreamReader.java:176)
at org.yaml.snakeyaml.reader.StreamReader.ensureEnoughData(StreamReader.java:171)
at org.yaml.snakeyaml.reader.StreamReader.peek(StreamReader.java:126)
at org.yaml.snakeyaml.scanner.ScannerImpl.scanToNextToken(ScannerImpl.java:1177)
at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:287)
at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:227)
at org.yaml.snakeyaml.parser.ParserImpl$ParseImplicitDocumentStart.produce(ParserImpl.java:195)
at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:148)
at org.yaml.snakeyaml.composer.Composer.checkNode(Composer.java:82)
at org.yaml.snakeyaml.constructor.BaseConstructor.checkData(BaseConstructor.java:123)
at org.yaml.snakeyaml.Yaml$1.hasNext(Yaml.java:507)
Cause analysis:
I remember converting the suffixes of properties files to YML files directly according to the video, and then the Chinese comments on the page became garbled, so I naturally converted them to GBK format, and then the above error was reported
The first possibility is that there is a problem with the encoding format of your application.yml file, which is changed to UTF-8
the second possibility is that your application.yml file is generated by directly changing the suffix of other types of files to YML. At this time, you need to copy all the contents in application.yml, delete them, and then create a new application.yml file, Copy the copied content into it and then run the project, and no error will be reported.
Solution:
Find file coding in the setting of idea
Convert GBK to UTF-8, and then rewrite the Chinese annotation to run normally
Read More:
- org.yaml.snakeyaml.error.YAMLException: java.nio.charset.MalformedInputException: Input length = 1
- [Solved] Mac ES Startup Error: Exception in thread “main“ java.nio.file.NotDirectoryException
- CMD input Java error could not create the Java virtual machine
- Solve the problem of testing redis cluster“ java.lang.NumberFormatException : For input string: “ [email protected]@17002 “And so on
- Vscode debug Java console input: evaluation failed because the thread is not suspended
- How to restrict input field to only input pure numbers in HTML
- Vue element El input search to achieve anti shake @ input event requests frequently
- Assertion `input_val >= zero && input_val <= one` failed
- vector length_error
- Springboot modifies the reference of the application.yml or. Properties file to report an error after startup
- If JavaScript exceeds the length of the array, no error will be reported
- Jetty9 change post request length
- Teradata bteq does not support the length function
- Analysis of R language error replacement has length zero problem
- error TS2339:Property ‘length’ does not exist on type ‘object’
- Pre initialization of list content and length in Python
- The problem of “value error: zero length field name in format” in Python 2.6.6 of CentOS 6.9
- Android monitor EditText text input EditText monitor events and input events
- Girl: RPC failed; HTTP 411 curl 22 the requested URL returned error: 411 length required:
- Python: How to Fix “Ord() expected string of length 1, but int found”