Cannot resolve class or package 'dbcp' Cannot resolve class 'BasicDataSource'
39 Cannot or Class package resolve dbcp
2023-09-14 09:11:44 时间
在applicationContext.xml中配置数据源时,报错如下:
Cannot resolve class or package 'dbcp'
Cannot resolve class 'BasicDataSource'
错误原因:
可能是没有导入common-dbcp.jar包,也可能是导入的jar包版本不正确。
解决方法:
下载jar包并导入,jar包地址如下:
https://commons.apache.org/proper/commons-dbcp/download_dbcp.cgi
如果是Java 7.0及其以上,需要导入common-dbcp2.jar
并在applicationContext.xml修改配置,将dbcp改为dbcp2,如下示
<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close" > </bean>
相关文章
- VUE - 使用axios数据请求时数据绑定时 报错 TypeError: Cannot set property 'xxxx' of undefined 的解决办法
- Self referencing loop detected for property 'XXXXXX' with type
- 【python】if __name__ == '__main__' 浅析
- Unable to access 'default.path.data' (/var/lib/elasticsearch)
- maven报 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile(defalut-compile) on project 项目名称:No such compile 'javac'
- php时区设置 warning: strtotime(): It is not safe to rely on the system's timezone settings
- What's new in dubbo-go v1.5.6
- ImportError: cannot import name 'HTTPClientFactory' from 'twisted.web.client' (unknown location)
- [Typescript] Tips: Make accessing objects safer by enabling 'noUncheckedIndexedAccess' in tsconfig
- [Angular 9] Improved Dependency Injection with the new providedIn scopes 'any' and 'platform'
- [Angular-Scaled web] 4. Using ui-router's named views
- HTTP request is unauthorized with client authentication scheme 'Anonymous'.
- python操作mongodb查询出现Object of type 'ObjectId' is not JSON serializable解决方法
- 'MySQLConverter' object has no attribute '_navigablestring_to_mysql'
- ImportError: cannot import name 'HTTPClientFactory' from 'twisted.web.client' (unknown location)
- [Typescript] Tips: Use 'in' operator to transform a union to another union(watched)
- [CSS3] The different of Background-size between 'cover' and 'contain'
- [Angular] Dynamic component's instance and sorting
- [FAQ][Hardhat] Error HH501: Couldn't download compiler version 0.8.0. Please check your connection.
- Atitit 数据存储的分组聚合 groupby的实现attilax总结
- Atitit.prototype-base class-based 基于“类” vs 基于“原型”
- Atitit. Atiposter 发帖机 新特性 poster new feature v7 q39
- Atitit.收银机小票打印功能的设计 java php c#.net版本
- Atitit.论垃圾文件的识别与清理 文档类型垃圾文件 与api概要设计pa6.doc
- 【Codeforces Round #443 (Div. 2) A】Borya's Diagnosis
- DataGrip设置长sql语句自动换行 & Navicat工具 结构同步 & idea启动maven项目报:'@' that cannot start any token. (Do not use @ for indentation)
- Multiple annotations found at this line: - cvc-elt.1: Cannot find the declaration of element 'beans' 解决办法
- VM1059 bootstrap-table.min.js:7 Uncaught TypeError: Cannot read property 'classes' of undefined
- cannot import name 'UMAP' from 'umap'
- cannot bind non-const lvalue reference of type 'std::__cxx11::string&
- @PathVariable不起作用,报错:Cannot resolve @PathVariable ' '
- Python3.6 AES加密 pycrypto 更新为 pycryptodemo | TypeError: Object type <class 'str'> cannot be passed to C code
- mysql版本:'for the right syntax to use near 'identified by 'password' with grant option'