Problem Description
An error was reported when starting the Spring Boot project. It was fine when it was started before. I don’t know why it suddenly reported an error when starting this time mapping values are not allowed here
, as follows:
Cause Analysis
It seems that there is a problem with the configuration file, and then I checked on the Internet and said that the format of the yml file is relatively strict, and there must be a space after each colon. Then I checked several times to make sure that there is a space after each colon. , I found the problem when I was puzzled:
solution
url
, username
, password
should be derver-class-name
at the same level as and, but it is assigned to derver-class-name
the next level, and it runs successfully after the change, as follows:
Summarize
When the project reports an error mapping values are not allowed here
, there is a high probability that there is a problem with the configuration file. Observe the location of the guide when the error is reported. There may be two reasons for the error:
- There must be a space after the colon, otherwise an error will be reported;
- Note that attributes at the same level are placed on the same layer, and no more tabs are allowed;