天天看點

No matching bean of type [xx] found for dependency: expected at least 1 bean which qualifies as auto...

這個看起來很弱爆的問題其實是因為其他的配置檔案中已經出現了為xx定義好的注入.如果用@Autowired就會得到上面的錯誤 , 但是用@Resource的時候就會看到類似下面的錯誤

Bean named 'moneyRecordDao' must be of type [com.fuscent.core.dao.MoneyRecordDao], but was actually of type [com.yooli.currentproduct.dao.impl.MoneyRecordDaoImpl]

感覺自己弱爆了啊.

轉載于:https://www.cnblogs.com/taojintianxia/p/4644997.html