Caused by: java.nio.charset.MalformedInputException: Input length = 1
2024-10-21 05:48:42
java.lang.IllegalStateException: Failed to load property source from location 'classpath:/application.yml'
at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.loadIntoGroup(ConfigFileApplicationListener.java:476)
at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:465)
at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:386)
at org.springframework.boot.context.config.ConfigFileApplicationListener.addPropertySources(ConfigFileApplicationListener.java:225)
at org.springframework.boot.context.config.ConfigFileApplicationListener.postProcessEnvironment(ConfigFileApplicationListener.java:195)
at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEnvironmentPreparedEvent(ConfigFileApplicationListener.java:182)
at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEvent(ConfigFileApplicationListener.java:168)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:74)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:325)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:296)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
at com.chinanums.schoolspayment.SchoolspaymentApplication.main(SchoolspaymentApplication.java:10)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: org.yaml.snakeyaml.error.YAMLException: java.nio.charset.MalformedInputException: Input length = 1
at org.yaml.snakeyaml.reader.StreamReader.update(StreamReader.java:254)
at org.yaml.snakeyaml.reader.StreamReader.<init>(StreamReader.java:58)
at org.yaml.snakeyaml.Yaml.loadAll(Yaml.java:518)
at org.springframework.beans.factory.config.YamlProcessor.process(YamlProcessor.java:157)
at org.springframework.beans.factory.config.YamlProcessor.process(YamlProcessor.java:135)
at org.springframework.boot.env.YamlPropertySourceLoader$Processor.process(YamlPropertySourceLoader.java:101)
at org.springframework.boot.env.YamlPropertySourceLoader.load(YamlPropertySourceLoader.java:58)
at org.springframework.boot.env.PropertySourcesLoader.load(PropertySourcesLoader.java:128)
at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.doLoadIntoGroup(ConfigFileApplicationListener.java:490)
at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.loadIntoGroup(ConfigFileApplicationListener.java:473)
... 22 common frames omitted
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
第一种可能是你的application.yml文件编码格式有问题,改为UTF-8,如下:
第二种:
可能就是你的application.yml文件是通过把其他类型的文件后缀名直接改为yml生成的,这时就需要你把application.yml中的内容全部复制,然后删除,再新建一个application.yml文件,
将复制的内容拷贝进去再运行项目就不会报错了。
最新文章
- 使用HTML5开发Kinect体感游戏
- AdapterPattern(适配器模式)
- ldap日志
- NOIP1999 旅行家的预算
- Writing On-Error Trigger In Oracle Forms
- MemoryStream 的GetBuffer() 和 ToArray()的区别
- js面向过程改写成面向对象--通用方法
- python 闭包(closure)
- iPhone mobile safari fixed 元素滚动慢的问题处理
- RSA, ACS5.X 集成配置
- Apache错误:(20014)Internal error: Error retrieving pid file logs/httpd.pid
- centos7.4安装npm
- JS 将canvas画布保存到本地
- 精选!15个必备的VSCode插件
- PAT 1015 Reversible Primes
- Ie11 的改变
- SSH客户端提示 用户密钥未在远程主机上注册
- 205-react SyntheticEvent 事件
- c语言博客作业01—分支、顺序结构
- python—退出ipython3的help()
热门文章
- Tomcat启动原理/使用tomcat的应用是如何从tomcat的main函数开始运行的
- python使用consul进行服务注册和发现
- 【神经网络与深度学习】【计算机视觉】YOLO2
- Eventbus的功能
- Maven打包报错:[WARNING] The POM for xxx is missing, no dependency inform
- maven设置阿里云仓库
- Java开发笔记(一百一十六)采用UDP协议的Socket通信
- PHP CLI中,三个系统常量:STDIN、STDOUT、STDERR
- Spring系列(三):Spring IoC源码解析
- Tkinter &; mysql 的登录框练习