springboot Caused by: java.nio.charset.MalformedInputException: Input length = 1

springboot Caused by: java.nio.charset.MalformedInputException: Input length = 1
Caused by: java.nio.charset.MalformedInputException: Input length = 1
at java.nio.charset.CoderResult.throwException(CoderResult.java:281)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:339)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
at org.yaml.snakeyaml.reader.UnicodeReader.read(UnicodeReader.java:125)
at org.yaml.snakeyaml.reader.StreamReader.update(StreamReader.java:223)
… 31 common frames omitted
启动项目马上关闭
有人说
1.application.yml文件编码格式有问题,改为UTF-8
还有人说
2.可能就是你的application.yml文件是通过把其他类型的文件后缀名直接改为yml生成的,这时就需要你把application.yml中的内容全部复制,然后删除,再新建一个application.yml文件,将复制的内容拷贝进去再运行项目就不会报错了。

我用这个方法解决,再pom.xom里面设置

<properties>
        <java.version>1.8java.version>
        <project.build.sourceEncoding>UTF-8project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8project.reporting.outputEncoding>
        <maven.compiler.encoding>UTF-8maven.compiler.encoding>
    properties>

springboot Caused by: java.nio.charset.MalformedInputException: Input length = 1_第1张图片
在setting设置在这里插入图片描述
springboot Caused by: java.nio.charset.MalformedInputException: Input length = 1_第2张图片

你可能感兴趣的:(springboot Caused by: java.nio.charset.MalformedInputException: Input length = 1)