当前位置:网站首页>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
边栏推荐
- How to set tiktok mobile network environment? How can tiktok break the playback volume?
- [artifact] screenshot + mapping tool snipaste
- Selenium runs slowly - speed up by setting selenium load policy
- PreScan快速入门到精通第十九讲之PreScan执行器配置、轨迹同步及非配多个轨迹
- CarSim仿真快速入门(十六)—CarSim传感器仿真之ADAS Sensor Objects (2)
- 从瞳代到“瞳代”再到品牌,暴利的美瞳的变与未变
- Wxss template style and WXS scripting language for wechat applet development
- An idea of solving div adapting to screen
- Export and call of onnx file of pytorch model
- Can you tell me whether mindspore supports torchvision Model directly uses the pre trained network, such as vgg16
猜你喜欢

C # add multi line and multi column text watermark in word

微信小程序开发之网络数据请求

授权无线通信标准

Research and application of servo driver in robot
EZDML reverse engineering import database analysis practical operation tutorial

微信小程序开发之WXSS模板样式与WXS脚本语言

Ml programming skills:

随机梯度下降法、牛顿法、冲量法、AdaGrad、RMSprop以及Adam优化过程和理解

The JS paging plug-in supports tables, lists, text, and images

Six axis sensor use learning record
随机推荐
Day7: ordered binary tree (binary search tree)
PreScan快速入门到精通第十八讲之PreScan轨迹编辑的特殊功能
从瞳代到“瞳代”再到品牌,暴利的美瞳的变与未变
Bash does not add single quotes to your string
Gbase 8s UDR memory management_ 01_ mi_ alloc
创意下拉多选js插件下载
Network data request for wechat applet development
What is idealism
【神器】截图+贴图工具 Snipaste
VMware virtual machine download, installation and use tutorial
Creative drop-down multi choice JS plug-in download
Configure and install cocos2dx development environment under Tongxin UOS
C语言学习日记3——realloc函数
由一个蓝桥杯基础题报时助手而引出的常见误区
安全基础4 ---正则表达式
Can you tell me whether mindspore supports torchvision Model directly uses the pre trained network, such as vgg16
Mindspore1.1.1 source code compilation and installation -- errors in the core compilation stage
4、Nacos 配置中心源码解析之 服务端启动
Hongke shares | how to solve blackmail software security vulnerabilities
Oracle数据库下载、安装、使用教程及问题汇总