敲了一个小例子,改了两个多小时错误
一、test没有run函数,无法测试,原因导错了包,应该是
import org.junit.jupiter.api.Test;
而我导入了
import org.junit.Test;
改正后还是报错
Description:
Failed to bind properties under 'person.dog' to com.example.pojo.Dog:
Reason: No converter found capable of converting from type [java.lang.String] to type [com.example.pojo.Dog]
Action:
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'person.dog' to com.example.pojo.Dog
等等一系列的错误,继续检查,发现是yaml文件里的属性缩进,空格有误。一定要注意yaml文件的语法格式,报的错真的是找不到头绪。