【4.0.0-RC2 & 4.0.0-RC3-SNAPSHOT】sharding-jdbc-spring-boot-starter init dataSource failed
See original GitHub issueBug Report
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
The is no problem in old version. when I upgrade to 4.0.0-RC2 or 4.0.0-RC3-SNAPSHOT, the dataSource can’t init
I found the problem may be in class shardingsphere/shardingjdbc/spring/boot/SpringBootConfiguration.java
can’t  get dataSource.
Issue Analytics
- State:
- Created 4 years ago
- Comments:28 (3 by maintainers)
 Top Results From Across the Web
Top Results From Across the Web
【4.0.0-RC2 & 4.0.0-RC3-SNAPSHOT】sharding-jdbc-spring ...
Bug Report Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Read more > Top Related Medium Post
Top Related Medium Post
No results found
 Top Related StackOverflow Question
Top Related StackOverflow Question
No results found
 Troubleshoot Live Code
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free Top Related Reddit Thread
Top Related Reddit Thread
No results found
 Top Related Hackernoon Post
Top Related Hackernoon Post
No results found
 Top Related Tweet
Top Related Tweet
No results found
 Top Related Dev.to Post
Top Related Dev.to Post
No results found
 Top Related Hashnode Post
Top Related Hashnode Post
No results found

我发现什么原因了,也是被困扰了两天,是因为引入的druid方式错误, 错误引入方式:
<dependency><groupId>com.alibaba</groupId><artifactId>druid-spring-boot-starter</artifactId><version>${druid.version}</version></dependency>正确引入方式:<dependency><groupId>com.alibaba</groupId><artifactId>druid</artifactId><version>${druid.version}</version></dependency>this works for me.