service組件是寫介面的,配置了資料源。
web組件引入了service組件(相當于父組件吧)
service組件資料源配置本來是spring.datasource.xxx時,service和web組件啟動都不報錯。
本來想配置多資料源的,現在第一步就把我搞懵了。
問題是這樣的
我把service資料源配置改為了spring.datasource.ipv6.xxx
如圖




這時service沒問題,但是web組件確啟動報錯了。
報錯內容如下:
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
千萬別說去掉DataSourceAutoConfiguration,DataSourceTransactionManagerAutoConfiguration
web組件和service組件都配置了。
web啟動類如下

service組件啟動類如下:

注意:是配置了資料源的service組件不報錯,web組件報錯
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/85178.html
標籤:Web 開發
