最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

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

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

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

小波66 2018-09-12 20:32:27
@ConfigurationProperties(prefix = "imooc.security")public class SecurityProperties {.......}@RestControllerpublic class BrowserSecurityController {@Autowired private SecurityProperties securityProperties;}啟動(dòng)運(yùn)行會(huì)報(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è)贊

解決了嗎?樓主

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

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

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

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

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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