How to solve the problem that Spring boot appears Failed to load property source from location & # 039th classpathbank application.yml
This article mainly explains "how to solve the emergence of Failed to load property source from location 'classpath:/application.yml in Spring boot". The content of the explanation in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to solve the problem of Failed to load property source from location' classpath:/application.yml when Spring boot appears".
Recently, when I was working on a project based on Spring boot, I changed the application.yml, which caused the IDEA to start with an error:
Java.lang.IllegalStateException: Failed to load property source from location 'classpath:/application.yml
So there are three reasons for finding all kinds of solutions online:
The contents of the application.yml file are not indented in the correct format.
The comment on the yml file is "#", not "/ /".
The application.yml file code is inconsistent with the project code.
The first and second reasons are easy to rule out. The coding problems that afflict the vast number of programmers in China are the most difficult to deal with, and setting- > editor- > file encodings does not help.
But there is the ultimate solution:
Copy out the contents of the file and put it in np.
Delete the original application.yml.
Create a new application.yml and copy the contents of the file back.
Thank you for your reading, the above is the content of "Spring boot appears Failed to load property source from location 'classpath:/application.yml how to solve", after the study of this article, I believe you have a deeper understanding of Spring boot Failed to load property source from location' classpath:/application.yml how to solve this problem, the specific use of the situation also needs to be verified by practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!