亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

運行時報錯:Failed to bind properties under 'limit'


APPLICATION FAILED TO START

***************************


Description:


Failed to bind properties under 'limit' to com.imooc.luckymoney.LimitConfig:


? ? Property: limit.description

? ? Value: at least ${limit.minMoney} yuan, at most ${limit.maxMoney} yuan

? ? Origin: class path resource [application.yml]:9:16

? ? Reason: No setter found for property: description


Action:


Update your application's configuration



運行時報錯這個,寫的碼跟老師 的一樣,為什么還是會有這個錯誤呢


正在回答

1 回答

看看下面的粗體字,description有沒有setter方法?

package com.imooc.luckymoney;

import java.math.BigDecimal;

import org.springframework.beans.factory.annotation.Value;

import org.springframework.boot.context.properties.ConfigurationProperties;

import org.springframework.stereotype.Component;

@Component

@ConfigurationProperties(prefix = "limit")

public class LimitConfig {

private BigDecimal minMoney;

private BigDecimal maxMoney;

private String description;

public BigDecimal getMinMoney() {

return minMoney;

}

public void setMinMoney(BigDecimal minMoney) {

this.minMoney = minMoney;

}

public BigDecimal getMaxMoney() {

return maxMoney;

}

public void setMaxMoney(BigDecimal maxMoney) {

this.maxMoney = maxMoney;

}

public String getDescription() {

return description;

}

public void setDescription(String description) {

this.description = description;

}


}


0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

運行時報錯:Failed to bind properties under 'limit'

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號