shardingsphere: 【4.0.0-RC2 & 4.0.0-RC3-SNAPSHOT】sharding-jdbc-spring-boot-starter init dataSource failed

Bug 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.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 28 (3 by maintainers)

Most upvoted comments

我发现什么原因了,也是被困扰了两天,是因为引入的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>

我发现什么原因了,也是被困扰了两天,是因为引入的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.