java.lang.IllegalAccessError: org.apache.commons.dbcp.DelegatingPreparedStatement.isClosed()Z解决方案-程序员宅基地

技术标签: DBCP  Mybatis  

 今天在使用Spring+Mybatis+DBCP的时候报了这么一个错误

java.lang.IllegalAccessError: org.apache.commons.dbcp.DelegatingPreparedStatement.isClosed()Z
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:78)
	at com.sun.proxy.$Proxy13.isClosed(Unknown Source)
	at org.apache.ibatis.executor.BaseExecutor.closeStatement(BaseExecutor.java:285)
	at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:65)
	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:326)
	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)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
	at com.sun.proxy.$Proxy10.selectList(Unknown Source)
	at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230)
	at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:139)
	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:76)
	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)
	at com.sun.proxy.$Proxy11.queryOrderAll(Unknown Source)
	at com.gpnu.mybatis.test.mybatis_spring.test(mybatis_spring.java:27)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	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.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	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:89)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)

 首先检查jar包有没有导入

发现已经导入了。

查询各种资料后,发现自己DBCP的版本与Mybatis的版本不兼容

 

所以我将Mybatis的jar包改成前一点的版本,问题解决

 

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/a549654065/article/details/84780745

智能推荐

2011年蓝桥杯第2届单片机省赛真题——“模拟智能传送装置”_第二届蓝桥杯模拟智能传送_邪o_O的博客-程序员宅基地

第一篇,2011年蓝桥杯第2届单片机省赛真题——“模拟智能传送装置”,后续会继续出其他届的省赛真题,此代码的EEPROM存储是有问题的,欢迎各位大佬指正。_第二届蓝桥杯模拟智能传送

LAN8720A不能正常通讯的问题_lan8720容易坏_LostSpeed的博客-程序员宅基地

笔记公司有块MCU板(STM32407VGT6 + LAN8720A/AI), 板子是好的, 以前一直在用, 固件工程也是归档的, 软件也是正常的.公司同事去年焊接了20个MCU板, 出货了3块板子, 剩下的板子就丢在那.这几天, 要用这个板子, 找到上次焊接的MCU板子, 插到到主板上, 程序烧录进入后, 网线插入, 连接设备和开发本本, 开发本本上的网卡一直显示网线已经被拔出.开始怀疑是程序不是对应版本的, 看svn归档记录, 固件工程就是这个.同事就怀疑我程序整错了. 那就查呗.在固件工程_lan8720容易坏

java.lang.NoClassDefFoundError: org/apache/htrace/SamplerBuilder-程序员宅基地

实验环境jdk1.8Hadoop2.9.1Zookeeper3.4.10Hbase2.1.1报错如下java.lang.NoClassDefFoundError: org/apache/htrace/SamplerBuilder at org.apache.hadoop.hdfs.DFSClient.<init>(DFSC..._java.lang.noclassdeffounderror: org/apache/htrace/samplerbuilder

岁月温柔-11 妈妈出汗多秋衣湿了不换的真正原因-程序员宅基地

2019年11月16日,上海晴天/老家阴天今天妈妈跟我打电话用了油汀后,早晨起来,感觉呼吸有些难受,半夜后背经常都是湿漉漉的,穿上弟弟购买的保暖内衣,特别容易出汗,如果换洗衣服的话。我说保暖内衣确实容易憋出汗来,在室内穿的话,烤火或者其它容易出汗,在室内穿比较透气的棉质秋衣秋裤就好了。另外我还提了一点就是,可能油汀时间用长了之后,空气不太流通,容易闷;或者是时间长了,空气干燥,我...

Java 实体转换工具类_java实体转换工具类-程序员宅基地

import com.github.dozermapper.core.DozerBeanMapperBuilder;import com.github.dozermapper.core.Mapper;import java.util.ArrayList;import java.util.List;/** * 实体和业务对象转换工具类 * * @date 2020-02-21 ..._java实体转换工具类

LQBv23-Python:三升序列_python于一个字母矩阵,我们称矩阵中的一个递增序列是指在矩阵中找到两个字母,它们-程序员宅基地

2019-/National_C_C++_A/试题 A:三升序列【问题描述】对于一个字母矩阵,我们称矩阵中的一个三升序列是指在矩阵中找到三个字母,它们在同一行,同一列,或者在同一 45 度的斜线上,这三个字母从左向右看、或者从上向下看是递增的。例如,如下矩阵中YQPDBKEZAFYV有BKZ、BEZ、AFY、AFV、AKP、DEF 等 6 个三升序列。注意当三个字母是从左下到右上排列时,从左向右看和从上向下看是不同的顺序。对于下面的 30 行 50 列的矩阵,请问总共有多少个三升序列?_python于一个字母矩阵,我们称矩阵中的一个递增序列是指在矩阵中找到两个字母,它们

随便推点

GitLab任意文件读取漏洞CVE-2020-10977重现_cve-2020-10977漏洞复现-程序员宅基地

漏洞描述地址: https://www.freebuf.com/vuls/235982.htmlGitlab安装官方地址: https://docs.gitlab.com/omnibus/docker/启动docker:注意版本号,不要用最新版本,这个漏洞是有相关版本的docker run --detach \ --hostname 192.168.1.22 \ --publish 9443:443 --publish 980:80 --publish 922:22 \ -_cve-2020-10977漏洞复现

曲径通幽——遇见未知的你-程序员宅基地

  “反正9个平行志愿都已经填了8个了,前面肯定就录取了,最后一个志愿就随便填个211,随便写个专业算了。”2016年7月,尚还沉浸在高考失利的烦闷情绪当中的我,看着那高不成低不就的尴尬分数,甚是头疼,甚至于还起了复读的心思。“全英文专业?呵,翻了这么多厉害学校的志愿都没找到这种专业,怕你啊?反正也到不了这儿。”毛躁的我,在第九志愿:东北师范大学后面随意的勾选了软件工程,其余的专业一个没...

C语言 实验9-1 计算职工工资 (15分)_计算职工工资c语言-程序员宅基地

因为没有给出N的范围,为了节约内存,最好选用动态内存分配。总的来说就是 动态内存分配+结构+结构指针#include<stdio.h>#include<stdlib.h>struct em { char name[10]; float jiben; float fudong; float zhichu; float gongzi;};int main (void){ int n,i; struct em *s; scanf("%d", &n);._计算职工工资c语言

Q - Uncowed Forces_一只小熊做蹲起的博客-程序员宅基地

Q - Uncowed ForcesKevin Sun has just finished competing in Codeforces Round #334! The round was 120 minutes long and featured five problems with maximum point values of 500, 1000, 1500, 2000, and 2500, respectively. Despite the challenging tasks, Kevin wa

学习笔记(07):JavaWeb基础核心技术-11. 佟刚_JavaWEB_GenericServlet-程序员宅基地

本Java视频教程涵盖JavaWEB 企业级开发所需的Servlet、JSP、MVC 设计模式、EL 表达式、JavaBean、国际化、Cookie和HttpSession、JavaMail等全部核心技术。  授课过程中通过多个企业级案例,将各知识点融会贯通。..._javaweb基础核心技术 佟刚 ppt

Python3+Opencv3 答题卡识别-程序员宅基地

参考:https://my.oschina.net/DDigimon/blog/1236298?tdsourcetag=s_pctim_aiomsg 小计:1)cv2.Canny(): cv2.Canny()第一个参数是输入图像,第二和第三个分别是minVal和maxVal。minVal和maxVal。当图像的灰度梯度高于maxVal时被认为是真的边界,那些低于minVal的...