原文:springboot jpa mongodb 整合mysql Field in required a bean of type that could not be found Failed to load ApplicationContext

.完整報錯 .原因 項目本來是連mongodb的,然后想連mysql的,jpa依賴添加不對就會詭異的報錯,如下正確的jpa的依賴被注釋了 然后,引入如下的jpa依賴就會報錯 .解決方法 先是打開原先jpa依賴,然后刪掉錯誤的依賴,還是報錯,最后重新切了新分支,不添加錯誤依賴就可以了 ...

2018-06-14 09:52 0 1159 推薦指數:

查看詳情

SpringBoot: Field xxx in xxx required a bean of type 'xxx' that could not be found.

SpringBoot自動注入報了如下錯誤 、 原因是我這個模塊依賴另一個模塊里面的被Spring管理的類,但是不在同一包下面, 並且啟動類不是在根包下面,所以就導致了springboot啟動的時候掃描不到,也就管理不到這個類,也就無法找到, 解決方案 ...

Sat Jan 04 04:26:00 CST 2020 0 1093
Field XXX in XXXX required a bean of type XXXX that could not be found

這個報錯的意思是:沒有找到相應的bean。 出現這個情況我遇到了兩種: 1.spring沒有掃描到相應的bean。 原因是springboot項目啟動,只有@SpringBootApplication 所在的包被被掃描,如果有其他需要掃描的包,需要顯式寫明 ...

Sat Oct 27 18:53:00 CST 2018 0 10210
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM