yml文件girl:cupSize: Bage: 18GirlProperties 类@ConfigurationProperties(prefix = "girl",locations = "application.yml")public class GirlProperties { private String cupSize; private Integer age; public String getCupSize() { return cupSize; } public void setCupSize(String cupSize) { this.cupSize = cupSize; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; }错误信息Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.2017-12-12 23:35:53.086 ERROR 4108 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : ***************************APPLICATION FAILED TO START***************************Description:Field GirlProperties in cn.bdqn.girl.HelloController required a bean of type 'cn.bdqn.girl.GirlProperties' that could not be found.Action:Consider defining a bean of type 'cn.bdqn.girl.GirlProperties' in your configuration.
添加回答
举报
0/150
提交
取消