1) 启动springboot 项目,出现java.sql.SQLException: The url cannot be null

    因为我之前是用的单库,直接用的druid 方式,改为分库结构的时候,把原来的druid 删除掉了,只引用了sharding,所以出现上诉错误;调整为:

<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>druid-spring-boot-starter</artifactId>
    <version>1.1.16</version>
</dependency>
<!--shardingsphere的springboot依赖jar-->
<dependency>
    <groupId>org.apache.shardingsphere</groupId>
    <artifactId>sharding-jdbc-spring-boot-starter</artifactId>
    <version>4.0.0-RC1</version>
</dependency>

<dependency>
    <groupId>org.apache.shardingsphere</groupId>
    <artifactId>sharding-jdbc-spring-namespace</artifactId>
    <version>4.0.0-RC1</version>
</dependency>

2)修改了引用包后,启动又出现 Data sources cannot be empty

     原来我配置文件写的是sharding.jdbc.datasource 这样格式的,还是沿用3.1版本的

     最后修改为 spring.shardingsphere.datasource 这样格式就可以了,下面为部分截图

ShardingSphere +springboot+mybatis 出现问题记录

相关文章:

  • 2021-10-07
  • 2021-10-18
  • 2021-05-04
  • 2022-12-23
  • 2021-09-02
  • 2022-02-23
  • 2022-12-23
  • 2021-05-20
猜你喜欢
  • 2022-12-23
  • 2021-11-13
  • 2021-06-20
  • 2021-07-22
  • 2021-08-02
  • 2021-07-25
  • 2022-02-25
相关资源
相似解决方案