启动springboot是报错

yml文件

girl:
cupSize: B
age: 18


GirlProperties 类


@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.




qq_半宛清愁_1
浏览 1214回答 2
2回答

慕粉2109029135

应该是目录结构没有对

拖鞋_

你发一下你的项目结构我看看 我感觉是你项目结构的问题
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java