当前位置:网站首页>Idea failed to start the project yamlexception Chinese file encoding format
Idea failed to start the project yamlexception Chinese file encoding format
2022-07-25 08:14:00 【lzhfdxhxm】
Catalog
1. see application.yml Whether there is Chinese in the document
2. see application.yml The encoding format of , Is it right? UTF-8
4. If the project fails to start
5. Check whether the compilation format of the project is set to UTF-8
environmental information :
idea2021.1.1( notes : If it's another version idea, This problem may also occur )
SpringBoot 2.1.15.RELEASE
Problem description :
use idea start-up SpringBoot When the project is , The console reported an error :
java.lang.IllegalStateException: Failed to load property source from 'file:/D:/.../classes/application.yml' (classpath:/application.yml)
...
Caused by: org.yaml.snakeyaml.error.YAMLException:java.nio.charset.MalformedInputException: Input length = 1
The error description is loading application.yml When it failed , Exception is java.nio.charset.MalformedInputException. This exception involves the encoding format .
This
Solution :
Solutions :
- see application.yml Whether there is Chinese in the document
- see application.yml The encoding format of , Is it right? UTF-8
- Check whether the compilation format of the project is set to UTF-8
resolvent :
1. see application.yml Whether there is Chinese in the document
First of all, I looked at application.yml Whether there is Chinese in the document ( General coding problems , Both involve Chinese ): There is Chinese
2. see application.yml The encoding format of , Is it right? UTF-8
Check it again application.yml The encoding format of , Before the revision, yes GBK.
In fact idea Set the encoding format of the file in .
idea Set file encoding format :
File -> Settings -> Editor -> File Encodings
take
Properties Files (*.properties)Under theDefault encoding for properties filesSet toUTF-8, takeTransparent native-to-ascii conversionCheck the box in front .
Be careful :Transparent native-to-ascii conversion Also check

If you want to Separate modified The encoding format of a file :
Select Chinese file ,File -> File Properties -> File Encodings

3. Start project
If the project is successfully launched , Then there is no need for subsequent operations
4. If the project fails to start
take applicat.yml Copy the contents in , Delete application.yml file , newly build application.yml file , Copy the copied content into .
Or will application.yml After deleting the Chinese in the document , Input Chinese manually again .
Do this above , It is to make the Chinese format in the document become UTF-8 code .
Start project , See if it can start normally .
5. Check whether the compilation format of the project is set to UTF-8
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
</properties>
边栏推荐
- Introduction and installation of mongodb
- Efcore's solution of multi tenant zero script, table and database read-write separation under SaaS system
- Raspberry pie creation self start service
- Introduction and principle explanation of 30 common sensor modules in IOT embedded devices
- The difference between batchnorm and layernorm
- Rk3399 development board i2c4 attaching EEPROM instance
- Pricing is arbitrary, products are difficult to distinguish between true and false, and platforms are running away. Will the Tibetan market continue to be popular?
- [shader realizes shadow projection effect _shader effect Chapter 8]
- C# 43. 获取UDP可用端口
- 第3章业务功能开发(查询线索)
猜你喜欢

node+js搭建时间服务器

Rstudio shows that it can't connect to the web page, or it has a new website.

【黑马程序员】Redis学习笔记003:Redis事务

app耗电量测试

Raspberry pie 4B parsing PWM

efcore在Saas系统下多租户零脚本分表分库读写分离解决方案

Efcore's solution of multi tenant zero script, table and database read-write separation under SaaS system

【黑马程序员】Redis学习笔记001:Redis简介+五种基本数据类型

ArcGIS Pro脚本工具(10)——从图层生成.stylx样式符号

Oracle trigger creation
随机推荐
Some easy-to-use plug-ins and settings installed in vscode
People who lose weight should cry: it's no good not eating food, because your brain will be inflamed
Vscode remote connection server, switch to go version
Advanced C language (XII) - dynamic memory management
The 17th revitalization cup computer programmer (cloud computing platform operation and development) finals
【黑马程序员】Redis学习笔记005:企业级解决方案
一款强大的端口扫描工具(nmap)
A review of nature: gender differences in anxiety and depression - circuits and mechanisms
CM4 development cross compilation tool chain production
If there is complex select nesting in the SQL of the flick CDC, when it encounters the binlog of delete, it will
R language error
Network file storage system (II) practical operation of Minio distributed file system
Refreshing mobile terminal personal center page
【keras bug】Tensor is unhashable if Tensor equality is enabled. Instead, use tensor.experimental_ ref(
Introduction to machine learning (I): understanding maximum likelihood estimation in supervised learning
yolov7 网络架构深度解析
Raspberry pie 3b ffmpeg RTMP streaming
7.24 simulation summary
Hotel room management system based on jsp+servlet+mysql
Raspberrypico serial communication