当前位置:网站首页>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>
边栏推荐
- Surpassing transformer, Tsinghua, byte significantly refresh parallel text generation SOTA performance | ICML 2022
- Science: listening to music can really relieve pain. Chinese scientists reveal the neural mechanism behind it
- Codeforces Round #809 Editorial(A,B,C)
- 第十七届振兴杯计算机程序设计员(云计算平台运维与开发)决赛
- Teach you to understand the computer optometry sheet
- eval与assert一句话木马分析
- enq: HW – contention等待引起的故障分析
- Message Oriented Middleware
- Enq: HW - fault analysis caused by content waiting
- VS2019 C# MFC安装
猜你喜欢

Svg creative underline style JS special effect
![[audio and video] picture YUV data format](/img/f6/922ff1f8bbbeff83a095a3ad5e797f.png)
[audio and video] picture YUV data format

Recommend 7 open source projects of yyds this week
Technical Analysis | Doris connector combined with Flink CDC to achieve accurate access to MySQL database and table exactly once

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

Surpassing transformer, Tsinghua, byte significantly refresh parallel text generation SOTA performance | ICML 2022

Redis fragment cluster

enq: HW – contention等待引起的故障分析

牛客动态规划训练

VS2019 C# MFC安装
随机推荐
Dijkstra序列(暑假每日一题 5)
Recommend 7 open source projects of yyds this week
Raspberrypico serial communication
Raspberry pie uses the command line to configure WiFi connections
Changes were made to tables that cannot be recreated or the prevent saving changes that require the table to be recreated option was enabled
Rstudio shows that it can't connect to the web page, or it has a new website.
Introduction and installation of mongodb
Efcore's solution of multi tenant zero script, table and database read-write separation under SaaS system
Pet adoption system based on ssm+mysql+layui
Numpy learning
C # introductory series (30) -- exception handling
【黑马程序员】Redis学习笔记005:企业级解决方案
Redis client tool redis insight recommendation
CAS操作
node+js搭建时间服务器
Advanced C language (11) - user defined data types
Summary of SQL skills in data warehouse development
【5G NR】UE注册拒绝原因
MVC mode three-tier architecture
Redis学习