第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會有你想問的

使用@ConfigurationProperties(prefix = "demo")注解修飾的類注入不進(jìn)來

使用@ConfigurationProperties(prefix = "demo")注解修飾的類注入不進(jìn)來

小波66 2018-09-12 20:32:27
@ConfigurationProperties(prefix = "imooc.security")public class SecurityProperties {.......}@RestControllerpublic class BrowserSecurityController {@Autowired private SecurityProperties securityProperties;}啟動運(yùn)行會報(bào)錯(cuò):***************************APPLICATION FAILED TO START***************************Description:Field securityProperties in com.imooc.security.browser.BrowserSecurityController required a bean of type 'imooc.security.core.properties.SecurityProperties' that could not be found.Action:Consider defining a bean of type 'imooc.security.core.properties.SecurityProperties' in your configuration.
查看完整描述

2 回答

?
Delete94

TA貢獻(xiàn)1條經(jīng)驗(yàn) 獲得超0個(gè)贊

解決了嗎?樓主

查看完整回答
反對 回復(fù) 2019-04-15
?
chandou

TA貢獻(xiàn)22條經(jīng)驗(yàn) 獲得超11個(gè)贊

少了一個(gè)注解注入到spring容器中,在你的class類SecurityProperties上增加注解@component即可

查看完整回答
反對 回復(fù) 2018-09-12
  • 小波66
    小波66
    加了這個(gè)@Component注解還是不可以,報(bào)相同的錯(cuò)誤。 當(dāng)我把 自動注入的給注釋掉,項(xiàng)目能跑起來 @Autowired private SecurityProperties securityProperties;
  • chandou
    chandou
    按照報(bào)錯(cuò)信息就是沒有將properties注入到容器中,去掉自動注入properties當(dāng)然可以了,去掉后啟動的時(shí)候不從容器中找這個(gè)配置文件的bean了,就不會報(bào)錯(cuò)
  • 2 回答
  • 0 關(guān)注
  • 9361 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號