spring boot 2.0 报错:“jdbcUrl is required with driverClassName.” 解决办法!

SpringBoot配置多数据源时报错 jdbcUrl is required with driverClassName 在Spring Boot 1.5.x之前,多数据源编程已经有很多教程和例子了,比如恒宇少年的博客还有程序猿DD的博客,我就是在两位大拿的教程下学习的。 但是在升级到Spring Boot 2.0后,一些配置及用法有了变化,如果不小心就会碰到“jdbcUrl is required with driverClassName.”的错误,解决方式有以下两种: 方法1:将配置文件application... 阅读详情
AI摘要

在将SpringBoot从1.0升级到2.0后,配置多数据源时遇到'jdbcUrlisrequiredwithdriverClassName.'错误。原因在于配置属性名的变化,需要将'spring.datasource.url'和'spring.datasource.driverClassName'改为'spring.datasource.jdbc-url'和'spring.datasource.driver-class-name'。修改配置后问题得到解决。

springboot 升级到2.0之后发现配置多数据源的时候报错:
“jdbcUrl is required with driverClassName.”或者Cause: java.lang.IllegalArgumentException: dataSource or dataSourceClassName or jdbcUrl is required.] with root cause

项目本来是但数据源配置,但是需求涉及另一个数据库,所以就把配置改成多数据源了,这里放下我刚改完的多数据源配置:
在这里插入图片描述
启动项目,发现报错“jdbcUrl is required with driverClassName.”,找到了一个大佬的博客:点击前往,根据这个大佬的博客分分钟解决了问题;其实错误的原因就是spring boot版本,原本在spring boot1.0的时候,配置数据源的路径和驱动时一般是写spring.datasource.url和spring.datasource.driverClassName,而在升级到2.0之后,是需要改成spring.datasource.jdbc-url和spring.datasource.driver-class-name的,改完即可解决问题。

改完之后的配置:
在这里插入图片描述
这样就可以解决了

springboot2.0报错jdbcUrl is required with driverClassName 1.问题 springboot2.0 配置多数据源时报错: spring: shardingsphere: datasource: names: ds-master-0,ds-master-1 # 第一个数据源 ds-master-0: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.cj.jdbc.Driver url: 阅读详情

相关推荐

先进封装技术 Part03---重布线层(RDL)的科普

RDL是一种在芯片封装过程中用于重新分布电气连接的技术。它通过在芯片表面或中介层上形成额外的布线层,重新分配芯片的I/O(输入/输出)位置,以适应不同的封装需求和提高电气连接的灵活性。

阿拉伯梳子的专栏 4697

jdbcUrl is required with driverClassName错误解决

jdbcUrl is required with driverClassName错误解决

Gblfy_Blog 1万+

【SAP GUI 脚本 VBA】实战:构建Excel驱动的SAP自动化操作平台

本文详细介绍了如何利用VBA和SAP GUI脚本构建Excel驱动的SAP自动化操作平台,实现高频事务码的标准化封装和批量处理。通过实战案例展示物料主数据查询(MM03)、会计凭证修改(FB02)等场景的自动化实现,帮助用户提升10倍+操作效率,同时确保数据可追溯性和操作安全性。

weixin_33748818的博客 503

jdbcUrl is required with driverClassName

spring.datasource.url 数据库的 JDBC URL。 spring.datasource.jdbc-url 用来重写自定义连接池 jdbcUrl is required with driverClassName 这是HikariDataSource报的没有配置jdbc-url导致的 com.zaxxer.hikari.HikariDataSource (Spring Boot 2.0 以上,默认使用此数据源) 如果是单个库,直接用 spring.datasource.driver.

小布1994的博客 1万+

HCIA重点知识

华为认证ICT工程师,是华为认证体系中用于标识个人能力在某一技术领域达到工程师级别的证明,表示通过认证的人员具备安装、配置、运行 ICT 设备,并进行基础故障排除的能力。抽象语言 -----> 编码 -----> 二进制 -----> 电信号 -----> 处理电信号信号的转换标准:协议,是一种允许电子设备相互交流的一系列标准的规则。即开放系统参考模型OSI/RM,简称“OSI”。OSI参考模型将计算机网络分为七个层次,自上而下依次为:应用层,表示层,会话层,传输层,网络层,数据链路层,物理层。1、应用层:

Awen0201的博客 2536

TSMaster二次开发实战:如何用Python搞定CAN/CANFD事件回调(附完整代码)

本文详细介绍了如何利用Python进行TSMaster二次开发,实现CAN/CANFD事件回调功能。通过实战代码演示,讲解了预发送与后处理回调的核心区别、注册流程、资源管理及性能优化技巧,帮助工程师高效构建自动化测试与数据监控应用。

star的博客 667

springboot2.x应用启动报jdbcUrl is required with driverClassName异常

(2)修改配置参数,spring.datasource.url改为spring.datasource.jdbc-url。

Borny鼎鼎的博客 1977

Windows11家庭版开启虚拟化与WSL安装操作手册

Windows 11 家庭版完全支持 WSL 2,无需升级到专业版即可享受 Linux 开发环境。通过本手册介绍的步骤,您可以顺利安装和配置 WSL,并掌握系统更新后的维护技巧。WSL 为开发者提供了在 Windows 环境下使用 Linux 工具链的便利,尤其适合需要跨平台开发的场景。随着使用深入,您会发现 WSL 生态系统的强大之处,它不仅能提高开发效率,还能让 Windows 用户体验到 Linux 的强大功能。建议定期查看微软官方文档,了解 WSL 的最新功能和最佳实践。

m0_54846764的博客 3018

spring boot 2.0 多数据源报错:“jdbcUrl is required with driverClassName.” 解决办法!

springboot 升级到2.0之后发现配置多数据源的时候报错: “jdbcUrl is required with driverClassName.”或者Cause: java.lang.IllegalArgumentException: dataSource or dataSourceClassName or jdbcUrl is required.] with root cause 主...

liu_yulong的专栏 928

openclaw通俗入门系列9——流式传输 + 分块

流式传输 = 不等写完就开始发。分块流式传输是把长回复切成几条消息发(所有渠道),草稿流式传输是像打字一样实时显示(仅 Telegram)。可以配置块大小、发送时机、合并规则、类人延迟。

m0_60605453的博客 506

FLACS-CFD 气云爆炸模拟全流程工况构建指南:从泄漏到爆炸

摘要: 本文详细介绍了使用FLACS-CFD模拟气云爆炸的全流程构建方法,重点解决泄漏模拟到爆炸模拟的气云文件传递问题。核心步骤包括: 项目规划:明确泄漏源(甲烷管道腐蚀泄漏)和爆炸场景,建立标准目录结构; 网格设计:泄漏与爆炸模拟需采用兼容的网格,爆炸域应为泄漏域的子区域且网格划分一致; 泄漏模拟配置:通过.inp文件定义几何、网格、风场、燃料及泄漏源参数,确保输出爆炸所需的气云文件(*.uni/*.fla); 关键设置:统一燃料名称、时间点匹配、路径正确性,避免版本兼容性问题。

huanghm88的专栏 757

spring boot2.0多数据源配置 jdbcUrl is required with driverClassName.

问题描述 springboot2.0版本终于在三月与大家见面本次升级可谓是一次重大升级,鉴于springboot2.0对众多插件进行升级并支持spring5于是公司也进行了一次版本升级升级中发现多数据源配置会提示 jdbcUrl is required with driverClassName. 于是就开始了排错之旅 所使用的技术栈 spring boot 2.0.2 j...

杨鹏的博客 6885

量化交易之因子分析大全

在机器学习项目中,特征工程是非常重要的。在量化研究中也是如此。本文将量化研究中常用到的特征,也就是因子进行详细收纳,并给出推导公式和实现代码。

夏之微风的博客 2282

Dynamic-datasource加载报错:jdbcUrl is required with driverClassName

问题描述 在给项目配置动态数据源时使用的时 <dependency> <groupId>com.baomidou</groupId> <artifactId>dynamic-datasource-spring-boot-starter</artifactId> <version>3.1.1</version> </dependenc

一只小码渣的博客 14万+

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

spring boot 2.0报错: dataSource or dataSourceClassName or jdbcUrl is required.] with root cause

java配置多数据源(mysql和Oracle)的时候出现这个问题 spring boot :error querying database. Cause: java.lang.IllegalArgumentException: dataSource or dataSourceClassName or jdbcUrl is required 主要原因是在1.0 配置数据源的过程中主要是写成:spr...

qq_42621977的博客 2万+

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

成功解决:Activiti HikariPool-1 - jdbcUrl is required with driverClassName.

Bug解决

杰森写代码 2835

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

解决Spring Boot数据库多数据源配置报jdbcUrl is required with driverClassName错误

原来的单数据源配置如下 spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://192.168.0.1:3306/mydb?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2B8 username: yeyu

野猿新一 3311

springboot连接数据库报错java.lang.IllegalArgumentException: jdbcUrl is required with driverClassName.

我以前的项目是用的springboot1.5.7版本,但后来另外一个项目我用了springboot2.0.2,这下连接数据库查询数据直接给我报错了java.lang.IllegalArgumentException: jdbcUrl is required with driverClassName.后来我在网上查找原因,因为1.5.x版本和2.0.x版本是有很大区别的,其他区别先不说,就说这个第一...

MrLi_IT的博客 4724

springBoot配置多数据源时报错 jdbcUrl is required with driverClassName.

这是由于springBoot1和2的写法区别 升级到springBoot2之后地址和驱动需要按照下面格式编写 spring.datasource.hikari.test1.driver-class-name = com.mysql.jdbc.Driver spring.datasource.hikari.test1.jdbc-url = spring.datasource.hikar...

小老弟的博客 5956

ERROR HikariConfig:781 - HikariPool-1 - jdbcUrl is required with driverClassName.

本人使用数据库连接池是HikariCP而不是自带的,对应的springboot版本:1.5.9。 报错原因如其所述,是因为配置文件不对,我把URL配置写成了: jdbc.medusa.url=xxx 正确的因该是: jdbc.medusa.jdbc-url=xxx 完整的正确配置如下: jdbc.medusa.driver-class-name=com.mysql.jdbc.Driver jdbc.medusa.jdbc-url=jdbc\:mysql\://你的目标IP地址\:对应的端口号/数据库名?

StarFarming的博客 457

13.1.从零开始学springboot-jdbcUrl报错问题

前言 博主近日在写springboot2.x(2.1.3)jdbc/jpa 多数据源的案例,运行代码时报错 jdbcUrl is required with driverClassName 原因 查阅了资料,发现还是springboot最细2.x版的原因 贴出两个关键配置: applicat...

chenkun2817的博客 753

springboot多数据源避坑指南

springboot多数据源避坑指南springboot多数据demo配置pom文件新增配置数据源配置项目结构代码链接报错1-jdbcUrl is required with driverClassName.报错2-com.mysql.jdbc.Connection.isValid(I)Z springboot多数据demo 最近在学习配置springboot多数据源,遇到了几个坑,现在总结出来 配置pom文件 <?xml version="1.0" encoding="UTF-8"?> &lt

可惜没如果的博客 864

IllegalArgumentException: jdbcUrl is required with driverClassName

jdbcUrl is required with driverClassName

weixin_66204660的博客 2309
上一篇: Java读写CSV文件以及解决split分割单元格内英文逗号的问题
下一篇: spring AOP配置切点及基础使用
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值