FAQ(11):Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNotFoundException: Cannot

anaconda的conda国内加速镜像源(pytorch 快速安装) 最近清华源不太好使了,所以推荐中科大镜像源,如下 1.还原原始通道 conda config --remove-key channels 2. 阅读详情

mybatis核心配置文件出错·!!

Log:

org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: java.sql.SQLException: Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNotFoundException: Cannot find class: "com.mysql.jdbc.Driver"
### The error may exist in com/smbms/dao/UserMapper.xml
### The error may involve com.smbms.dao.UserMapper.Usershow
### The error occurred while executing a query
### Cause: java.sql.SQLException: Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNotFoundException: Cannot find class: "com.mysql.jdbc.Driver"
	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:150)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)
	at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:137)
	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:75)
	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53)
	at com.sun.proxy.$Proxy4.Usershow(Unknown Source)
	at com.smbms.entities.UserTest.test01(UserTest.java:33)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: java.sql.SQLException: Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNotFoundException: Cannot find class: "com.mysql.jdbc.Driver"
	at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.initializeDriver(UnpooledDataSource.java:221)
	at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.doGetConnection(UnpooledDataSource.java:200)
	at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.doGetConnection(UnpooledDataSource.java:196)
	at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.getConnection(UnpooledDataSource.java:93)
	at org.apache.ibatis.datasource.pooled.PooledDataSource.popConnection(PooledDataSource.java:385)
	at org.apache.ibatis.datasource.pooled.PooledDataSource.getConnection(PooledDataSource.java:89)
	at org.apache.ibatis.transaction.jdbc.JdbcTransaction.openConnection(JdbcTransaction.java:138)
	at org.apache.ibatis.transaction.jdbc.JdbcTransaction.getConnection(JdbcTransaction.java:60)
	at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:336)
	at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:84)
	at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62)
	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)
	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)
	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)
	... 29 more

解决:
   Bug日志写的很明显:#{}  改为${}!!
原:
 
			<dataSource type="POOLED">
				<property name="driver" value="#{jdbc.driver}"/>
				<property name="url" value="#{jdbc.url}"/>
				<property name="username" value="#{jdbc.usename}"/>
				<property name="password" value="#{jdbc.password}"/>
			</dataSource>


改:
 		<dataSource type="POOLED">
			<property name="driver" value="${jdbc.driver}"/>
			<property name="url" value="${jdbc.url}"/>
			<property name="username" value="${jdbc.usename}"/>
			<property name="password" value="${jdbc.password}"/>
		</dataSource>





从菜鸟到大神:VSCode助力HTML开发全攻略 本文全面介绍 VSCode 在 HTML 开发中的高效应用。先引导读者完成 VSCode 的安装与个性化设置,助其快速适应开发环境;接着推荐 Live Server、Prettier 等实用插件,实现实时预览、代码格式化等功能,提升开发效率。通过详细的开发实战步骤,从新建文件到添加样式,带领读者掌握 HTML 基础结构与常用标签使用。还分享代码片段管理、多人协作等进阶技巧,解决常见开发问题。旨在帮助开发者利用 VSCode,轻松高效完成 HTML 开发,打造优质网页。 阅读详情

相关推荐

(3万字深度解析)Kaggle《房价预测:高级回归技巧》详解复现攻略

在这篇教程式文章中,我们从零开始完成了 Kaggle《房价预测:高级回归技巧》比赛的复现工作,涵盖了数据预处理、特征工程、模型训练、调优、解释和融合的完整流程。深入理解数据:阅读数据描述,结合常识对每个特征作出合理处理(如缺失值填充’None’表示无此设施 、异常值剔除 等)。对目标和偏态特征进行对数变换,使分布更平滑,从而更好满足模型假设并提升准确度。特征工程:我们创造了总面积、总浴室等新特征,整合信息提高模型可学习性。

qq_38334677的博客 1769

Error querying database. Cause: java.sql.SQLException: Error setting driver on UnpooledDataSource.

记录java Mybatis框架学习过程中遇到的问题 1、搭建第一个mybatis项目的时候发生异常: Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException: Error querying database. Cause: java.sql.SQLException: Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNo

qq_40818905的博客 6329

树莓派上基于ONNXRuntime与Qt的C++模型部署实战指南

本文详细介绍了在树莓派上使用ONNXRuntime与Qt进行C++模型部署的完整流程。从环境配置、依赖安装到交叉编译优化,再到Qt界面集成与ARM架构性能调优,提供了实战指南和常见问题解决方案,帮助开发者高效完成边缘设备上的AI应用部署。

ik6789012的博客 339

Error querying database. Cause: java.sql.SQLException: Error setting driver on UnpooledDataSource

mybatis执行增删改查是报错:Error querying database. Cause: java.sql.SQLException: Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNotFoundException: Cannot find class: com.mysql.jdbc.Driver 在学习最基本的Mybatis配置运行时报出了这样一个错误,出现的问题是没有成功加载driver驱动,至于为什么出现

qq_44869895的博客 1万+

linux 内核vxlan收发包流程

1.vxlan口收包处理流程 前面几章详细介绍了vxlan接口的使用,而且已经知道vxlan是 MAC IN UDP中的封装,因此,在解封装之前,一切按照原有流程走,在此复习一下内核收发包流程(驱动层的数据处理这次不再解析,直接从__netif_receive_skb_core开始) #物理网卡处理中断,触发softirq i40e_intr └─napi_schedule_irqoff #i40e softirq把包放到per cpu backlog,触发softirq i40e_napi_p

魏言华的博客 3825

实战指南!基于STM32的智能环境监测系统(代码+硬件设计+云端控制)

本文详细介绍了基于STM32的智能环境监测系统的设计与实现,包括硬件选型、电路设计、软件架构和云端控制。系统通过DHT11温湿度传感器和MQ-2烟雾传感器实时监测环境数据,STM32F103C8T6主控芯片处理数据并通过ESP8266上传至中国移动物联网平台,支持手机APP远程监控。项目成本低、稳定性高,适合智能家居和环境监测应用。

weixin_29194817的博客 433

第一次使用mybatis报错,Error querying database,度娘了一下,主要原因就是要将将com.mysql.jdbc.Driver独立出来

Error querying database. Cause: java.sql.SQLException: Error setting driver on UnpooledDataSource.错误,基础问题...

qq_24484317的博客 4979

RK356x U-Boot研究所(命令篇)3.10 bidram与sysmem相关命令的作用

RK356x U-Boot研究所(命令篇)3.10 bidram与sysmem相关命令的作用

Systemcall名屋 622

Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNotFoundException: Cannot find cla

最近在学Mybatis3,在使用中遇到下面的问题 1.在配置mybatis-config.xml 文件时,我想将将下图配置中的所有property属性提取到一个叫做db.properties的配置文件中,可是运行就报错 图1.mybatis-config.xml 文件 图2.db.properties 文件 Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNotFoundException: Cannot find cl

qq_45900875的博客 5479

基于Simulink的H∞鲁棒控制器设计与仿真建模示例

本文介绍了基于Simulink的H∞鲁棒控制器设计与仿真方法。针对质量-弹簧-阻尼系统存在±50%刚度不确定性的问题,详细阐述了从构建广义被控对象、设计性能加权函数,到使用hinfsyn综合控制器的完整流程。通过Simulink仿真验证,所设计的H∞控制器在参数摄动和外部扰动下均保持良好性能,位移控制误差小于2%,扰动衰减超过20dB。相比传统PID控制,H∞方法展现出显著鲁棒性优势。文章还总结了工程实践中的加权函数调参技巧、控制器降阶方法,并展望了μ-综合等扩展方向,为处理系统不确定性提供了实用解决方案。

amy_mhd的博客 70

网工、运维利器:MobaXterm,一款全能的远程工具

你好,这里是网络技术联盟站,我是瑞哥。是一款由Mobatek开发的多功能远程计算机管理工具,集成了多种网络协议和工具,专为网络工程师和系统管理员设计。它提供了丰富的远程连接功能,包括SSH、RDP、VNC、X11转发等,支持文件传输和多标签界面,内置了文本编辑器和多种网络工具,是一款全能的远程管理软件。MobaXterm的开发起始于2008年,最初只是一个简单的X服务器,但随着用户需求的不断增加和软件的逐步完善,MobaXterm逐渐发展成了一款功能全面、界面友好的远程管理工具。

网络技术联盟站 5229

MyBatis异常:Cause: java.sql.SQLException: Error setting driver on UnpooledDataSource.

刚刚使用MyBatis时常常会出现这个错误: Exceptioninthread"main"org.apache.ibatis.exceptions.PersistenceException: ###Errorqueryingdatabase.Cause:java.sql.SQLException:ErrorsettingdriveronUnpooledDataSource.Cause:java.lang.ClassNotFoundException:Cannotf...

weixin_56451725的博客 1858

国科大学习资料--高级软件工程-复习题选择题答案

国科大学习资料–高级软件工程(罗铁坚 魏峻 刘丹)-复习题选择题答案 ’‘

无名何许人的博客 1165

mybatis 执行查询时报错 【Error querying database. Cause: java.sql.SQLException: Error setting driver on Unp...

org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java.sql.SQLException: Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNotFoundException: ...

weixin_30263073的博客 9934

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

mybatis连接出现无法找到驱动的解决办法

今天在使用mybatis的时候,连接数据出现了如下的错误: org.apache.ibatis.exceptions.PersistenceException: Error querying database. Cause: java.sql.SQLException: Error setting driver on UnpooledDataSource. Cause: java.lang.C...

爱码士的博客 1039

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

FAQ(12):Error querying database. Cause: java.sql.SQLException

FAQ(12):Error querying database. Cause: java.sql.SQLException

Diligence is the mother of success. 5318

IEM模型,地表粗糙度模拟

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

Error setting driver on UnpooledDataSource

数据源配置取不到配置文件属性值 &amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&amp;gt; &amp;lt;!DOCTYPE configuration PUBLIC &quot;-//mybatis.org//DTD Config 3.0//EN&quot; &quot;http://mybatis.org/

qq_34651407的博客 1万+

org.apache.ibatis.exceptions.PersistenceException: Error querying database. Cause: java.sql.SQLEx

今天利用mybatis连接mysql数据库遇到了一些问题。 一直都在报一个错误 org.apache.ibatis.exceptions.PersistenceException: Error querying database. Cause: java.sql.SQLException: Error setting driver onUnpooledDataSource. Cause: ja...

weixin_45843683的博客 1210

Cause: java.sql.SQLException: Error setting driver on UnpooledDataSource.的解决方法

mysql版本和pom.xml文件中引入的mysql依赖的版本冲突。2.pom.xml文件中引入的mysql的依赖版本应该大于等于自己的mysql版本。1.查看自己的mysql的版本。3.jdbc.properties的配置。

Ersin555的博客 1126

Eplices中配置Mybatis时遇见The error may exist in SQL Mapper Configuration,相关问题的解决方案

JavaEE框架搭建中常见的配置中 The error may exist in SQL Mapper Configuration, Exception in thread "main" org.apache.ibatis.exceptions相关异常问题的解决方案

m0_47005019的博客 5481

运行mybatis时显示报错:Error updating database. Cause: java.sql.SQLException: Error setting driver on

在运行mybatis测试类的时候,结果报错; Error updating database. Cause: java.sql.SQLException: Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNotFoundException: Cannot find class: com.mysql.jdbc.cj.Driver Caused by: java.sql.SQLException: Error settin.

weixin_51735258的博客 8884

Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNotFoundException:

MySQL依赖版本不低于自己本地的MySQL版本

李赛男 1466

Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNotFoundException

记录在IDEA学习Java报错解决方法

wei_shuo的博客 941

Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNotFoundException: com.mysql.cj.jd

并且:今天学习bpm就简单做了个demo启动报错,很奇怪,网上找到很多案例最终发现是mysql版本问题。

weixin_44607784的博客 445
上一篇: FAQ(8):org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: ja
下一篇: FAQ(10):Type interface com.smbms.dao.UserMapper is not known to the MapperRegistry.
后台技术汇
博客等级 码龄11年 670粉丝 531原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

后台技术汇

对你的帮助,是对我的最好鼓励。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值