当前位置:网站首页>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>
边栏推荐
- JS cool rolling picture deformation animation JS special effects
- A simple hotel background management system based on jsp+servlet+mysql
- People who lose weight should cry: it's no good not eating food, because your brain will be inflamed
- DIY can decorate the mall system, you can also have!
- redis客户端工具redis-insight推荐
- [5g NR] UE registration rejection reason
- TCGA simple download tool V16 installation error
- Introduction and installation of mongodb
- 机器学习理论及案例分析(part1)--机器学习基础
- 【黑马程序员】Redis学习笔记001:Redis简介+五种基本数据类型
猜你喜欢

滴滴 - dispatching

Network packet loss, network delay? This artifact helps you solve all problems

Refreshing mobile terminal personal center page
![[shader realizes shadow projection effect _shader effect Chapter 8]](/img/f3/aa935cc1bb4983d5a8dc0a9710ec6e.png)
[shader realizes shadow projection effect _shader effect Chapter 8]

batchnorm 和layernorm的区别

刷题《剑指Offer》day01

475-82(230、43、78、79、213、198、1143)

Recommend 7 open source projects of yyds this week

The difference between batchnorm and layernorm

Message Oriented Middleware
随机推荐
Brush the title "sword finger offer" day02
TCGA simple download tool V16 installation error
【keras bug】Tensor is unhashable if Tensor equality is enabled. Instead, use tensor.experimental_ ref(
Network file storage system (II) practical operation of Minio distributed file system
475-82(230、43、78、79、213、198、1143)
The 17th revitalization cup computer programmer (cloud computing platform operation and development) finals
yolov7 网络架构深度解析
刷题《剑指Offer》day02
Chapter 3 business function development (modifying clues, data echo and modifying data)
Chapter 3 business function development (query clues)
Redis分片集群
第3章业务功能开发(修改线索,数据回显并修改数据)
Learn when playing No 6 | the magic of document library lies in
【黑马程序员】Redis学习笔记005:企业级解决方案
一款强大的端口扫描工具(nmap)
Raspberry pie 4B ffmpeg RTMP streaming
Pet adoption system based on ssm+mysql+layui
Learn when playing No 5 | human high quality examination, right here →
Hotel room management system based on jsp+servlet+mysql
Raspberrypico analytic PWM