原文:Spring多個數據源問題:DataSourceAutoConfiguration required a single bean, but * were found

原因: EnableAutoConfiguration 這個注解會把配置文件號中的數據源全部都自動注入,不會默認注入一個,當使用其他數據源時再調用另外的數據源。 解決方法: .注釋掉這個注解 .通過如下的方式禁止springboot自動注入多個數據源 SpringBootApplication exclude ...

2017-10-09 17:26 0 2505 推薦指數:

查看詳情

Field in required a single bean, but 2 were found:

我在其他類注入的時候出現以下錯誤 異常 Description: Field mibService in com.xxx.xxx.controller.SnmpController required a single bean, but 2 were found ...

Thu Jul 18 17:59:00 CST 2019 0 2986
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM