当前位置:网站首页>Notes - record a cannotfinddatasourceexception: dynamic datasource can not find primary datasource problem solving
Notes - record a cannotfinddatasourceexception: dynamic datasource can not find primary datasource problem solving
2022-07-25 19:52:00 【Focus on writing bugs】
List of articles
Problem scenario
take Springboot Project upgrade to Springcloud project , Because of the configuration Multiple data sources , There are a lot of strange pits .
among , There is one CannotFindDataSourceException: dynamic-datasource can not find primary datasource pit , I've been thinking about it for a long time , Miraculously solved .
The solution is strange , Please keep looking down .
Environment configuration
- nacos 1.3.0
- dynamic-datasource 3.5.0
Problem list and solutions
dynamic-datasource please check the setting of primary
appear dynamic-datasource please check the setting of primary This kind of problem , If the configuration files are correct , The following error reports still appear :
Show the current dynamic-datasource Dependent versions and Springboot Version incompatibility problem
Need to upgrade
dynamic-datasourceOf pom edition .
Reference blog
dynamic-datasource can not find primary datasource
If the configuration information is correct , Also aim at spring.datasource.dynamic.datasource Data sources in , Added default master node , Or configure other node names .
If it is Configure other names , You need to add spring.datasource.dynamic.datasource.primary Point to .
Pay attention here , If... Is set
spring.datasource.dynamic.datasource.xxxx.poolName.
thatspring.datasource.dynamic.datasource.primaryWill find the correspondingpoolNameMatching node configuration information .
If nacos in , The configuration file requirements are normal , The configuration information in the configuration center is still unavailable , Or after the configuration file changes , There is no automatic pull configuration and restart in the program log printing log Print , At this time, the most direct way :
restart nacos!
Reference blog
边栏推荐
- SDL text display
- Can you tell me whether mindspore supports torchvision Model directly uses the pre trained network, such as vgg16
- wallys//IPQ5018/IPQ6010/PD-60 802.3AT Input Output 10/100/1000M
- When the V100 of mindpole 8 card is trained to 101 epochs, an error of reading data timeout is reported
- tiktok手机网络环境怎么设置?tiktok怎么破播放量?
- Recommendations on how to install plug-ins and baby plug-ins in idea
- [wp]ctfshow-web入门-爆破
- Analysis of CMS station building system of common PHP in China
- 从瞳代到“瞳代”再到品牌,暴利的美瞳的变与未变
- PMP每日一练 | 考试不迷路-7.25
猜你喜欢

Binarysearch basic binary search

北航等《深度学习事件抽取》文献综述论文,27页pdf阐述当前趋势

一元函数积分学_分部积分法

919. Complete binary tree inserter

Flutter tips: optimizing the buildcontext you use

Is there a "fingerprint" in the structure of AAAI 2022 | Gan? Generating network structure from forged image traceability

Day7: ordered binary tree (binary search tree)

wallys//IPQ5018/IPQ6010/PD-60 802.3AT Input Output 10/100/1000M

Software designer afternoon real topic: 2009-2022

创意下拉多选js插件下载
随机推荐
Is there a "fingerprint" in the structure of AAAI 2022 | Gan? Generating network structure from forged image traceability
Js分页插件支持表格、列表、文本、图像
【神器】截图+贴图工具 Snipaste
When the V100 of mindpole 8 card is trained to 101 epochs, an error of reading data timeout is reported
Beihang and other "deep learning event extraction" literature review paper, 27 page PDF describes the current trend
Ml programming skills:
919. Complete binary tree inserter
PyTorch 模型 onnx 文件的导出和调用
Deeplobv1 and V2
一元函数积分学_分部积分法
Wechat applet 10 - wechat template
Introduction to web security ICMP testing and defense
Binarysearch basic binary search
tiktok手机网络环境怎么设置?tiktok怎么破播放量?
PMP每日一练 | 考试不迷路-7.25
What is idealism
Old wine in new bottles -- sample analysis of recent apt32 (sea Lotus) organizational attacks
How does tiktok break zero?
Scala基础【集合01】
打印数据库返回的查询数据是null,或者是默认值。与数据库返回的值不相符