Sign in
Sign up
Explore
Enterprise
Education
Search
Help
Terms of use
About Us
Explore
Enterprise
Education
Gitee Premium
Gitee AI
Sign in
Sign up
Fetch the repository succeeded.
Open Source
>
Web Development
>
Web Framework
&&
Donate
Please sign in before you donate.
Cancel
Sign in
Scan WeChat QR to Pay
Cancel
Complete
Prompt
Switch to Alipay.
OK
Cancel
Watch
Unwatch
Watching
Releases Only
Ignoring
557
Star
5.3K
Fork
2K
ssssssss-team
/
magic-api
Code
Issues
90
Pull Requests
9
Insights
Pipelines
Service
JavaDoc
Quality Analysis
Jenkins for Gitee
Tencent CloudBase
Tencent Cloud Serverless
悬镜安全
Aliyun SAE
Codeblitz
SBOM
Don’t show this again
Join Repository
Update failed. Please try again later!
Remove this flag
Content Risk Flag
This task is identified by
as the content contains sensitive information such as code security bugs, privacy leaks, etc., so it is only accessible to contributors of this repository.
Magic-Api不支持druid动态多数据源
Backlog
#ICJ4J3
山外有山
Opened this issue
2025-07-01 14:42
### 当前使用版本(必填,否则不予处理) 2.2.2 ### 该问题是怎么引起的? SpringBoot 3.4.5中配置了Druid动态多数据源,而Magic-Api启动时无法识别注册其他数据源,只能默认以主数据源注册。 ### 重现步骤(如果有就写完整) Druid动态多数据源配置  Magic-api配置中也指定了第二个数据源 magic-api: web: /magic/web resource: type: database # 配置存储在数据库中 tableName: magic_api_file # 数据库中的表名 datasource: slave ### 报错信息 ERROR org.springframework.boot.SpringApplication:858 - Application run failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'magicDatabaseResource' defined in class path resource [org/ssssssss/magicapi/spring/boot/starter/MagicAPIAutoConfiguration.class]: Failed to instantiate [org.ssssssss.magicapi.core.resource.Resource]: Factory method 'magicDatabaseResource' threw exception with message: 找不到数据源slave Failed to instantiate [org.ssssssss.magicapi.core.resource.Resource]: Factory method 'magicDatabaseResource' threw exception with message: 找不到数据源slave
### 当前使用版本(必填,否则不予处理) 2.2.2 ### 该问题是怎么引起的? SpringBoot 3.4.5中配置了Druid动态多数据源,而Magic-Api启动时无法识别注册其他数据源,只能默认以主数据源注册。 ### 重现步骤(如果有就写完整) Druid动态多数据源配置  Magic-api配置中也指定了第二个数据源 magic-api: web: /magic/web resource: type: database # 配置存储在数据库中 tableName: magic_api_file # 数据库中的表名 datasource: slave ### 报错信息 ERROR org.springframework.boot.SpringApplication:858 - Application run failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'magicDatabaseResource' defined in class path resource [org/ssssssss/magicapi/spring/boot/starter/MagicAPIAutoConfiguration.class]: Failed to instantiate [org.ssssssss.magicapi.core.resource.Resource]: Factory method 'magicDatabaseResource' threw exception with message: 找不到数据源slave Failed to instantiate [org.ssssssss.magicapi.core.resource.Resource]: Factory method 'magicDatabaseResource' threw exception with message: 找不到数据源slave
Comments (
2
)
Sign in
to comment
Status
Backlog
Backlog
Doing
Done
Closed
Assignees
Not set
Labels
Not set
Label settings
Milestones
No related milestones
No related milestones
Pull Requests
None yet
None yet
Successfully merging a pull request will close this issue.
Branches
No related branch
Branches (4)
Tags (80)
master
dev
3.0.0
leheyue/tablejoin
v2.2.2
v2.2.1
v2.2.0
v2.1.1
v2.1.0
v2.0.2
v2.0.1
v2.0.0
v2.0.0-beta.3
v2.0.0-beta.2
v2.0.0-beta.1
v1.7.5
v1.7.4
v1.7.2
v1.7.1
v1.7.0
v1.6.4
v1.6.3
v1.6.1
v1.6.0
v1.5.3
v1.5.2
v1.5.1
v1.5.0
v1.4.4
v1.4.5
v1.4.3
v1.4.2
v1.4.1
v1.4.0
v1.3.9
v1.3.8
v1.3.7
v1.3.6
v1.3.5
v1.3.4
v1.3.3
v1.3.2
v1.3.1
v1.3.0
v1.2.2
v1.2.1
v1.2.0
v1.1.3
v1.1.1
v1.1.2
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v1.0.0-beta2
v1.0.0-beta1
v0.7.1
v0.7.0
v0.6.1
v0.6.0
v0.5.5
v0.5.4
v0.5.3
v0.5.0
v0.4.8
v0.4.7
v0.4.6
v0.4.5
v0.4.4
v0.4.3
v0.4.2
v0.4.0
v0.4.1
v0.3.x
v0.3.4
v0.3.3
v0.3.2
v0.3.1
v0.2.1
v0.3.0
v0.2.0
v0.1.1
v0.1.0
v0.0.1
Planed to start   -   Planed to end
-
Top level
Not Top
Top Level: High
Top Level: Medium
Top Level: Low
Priority
Not specified
Serious
Main
Secondary
Unimportant
参与者(1)
Java
1
https://gitee.com/ssssssss-team/magic-api.git
[email protected]
:ssssssss-team/magic-api.git
ssssssss-team
magic-api
magic-api
Going to Help Center
Search
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register