【异常】SpringBoot3.2.0 Description: Failed to configure a DataSource: ‘url‘ att

mybatisPlus 多数据源导致

异常

复制代码
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
 
 
Action:
 
Consider the following:
	If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
	If you have database settings to be loaded from a particular profile you may need to activate it (the profiles dev are currently active).

解决

spring-boot 1.5.x 2.x.x

复制代码
<dependency>
  <groupId>com.baomidou</groupId>
  <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
  <version>${version}</version>
</dependency>

spring-boot3 使用以下依赖

复制代码
<dependency>
  <groupId>com.baomidou</groupId>
  <artifactId>dynamic-datasource-spring-boot3-starter</artifactId>
  <version>${version}</version>
</dependency>
相关推荐
Sunshine for you1 小时前
如何用FastAPI构建高性能的现代API
jvm·数据库·python
阿贵---1 小时前
Python Web爬虫入门:使用Requests和BeautifulSoup
jvm·数据库·python
道清茗2 小时前
【MySQL知识点问答题】 MySQL 配置参数和内存管理
数据库·mysql
2401_884563242 小时前
进阶技巧与底层原理
jvm·数据库·python
2401_873204652 小时前
使用Pandas进行数据分析:从数据清洗到可视化
jvm·数据库·python
ZGi.ai2 小时前
生产级 Agent 编排 从单一 LLM 调用到多智能体工作流的工程设计
大数据·数据库·人工智能
superkcl20222 小时前
1. QObject(parent) 核心含义
数据库
微学AI2 小时前
树莓派搭建便携弱网测试网关:基于 Facebook ATC 的实践指南
数据库·内网穿透
小江的记录本2 小时前
【Bean】JavaBean(原生规范)/ Spring Bean 【重点】/ 企业级Bean(EJB/Jakarta Bean)
java·数据库·spring boot·后端·spring·spring cloud·mybatis
m0_662577972 小时前
自动化与脚本
jvm·数据库·python