Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'dataSource'

Posted ddpapa

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'dataSource' 相关的知识,希望对你有一定的参考价值。

Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name ‘dataSource‘ defined in class path resource 

错误原因:缺少两个jar包

技术图片

 

 获得jar包方法:从maven仓库下载

网址:https://mvnrepository.com/

技术图片

 技术图片

 

 下载需要的jar包,复制到lib目录下右击项目添加到工程中。

技术图片

 

 

技术图片

 

 

以上是关于Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'dataSource' 的主要内容,如果未能解决你的问题,请参考以下文章

java.lang.ClassNotFoundException: Cannot find class: User

Tomcat报错:HTTP Status 500 - Wrapper cannot find servlet class

解决kylin报错 ClassCastException org.apache.hadoop.hive.ql.exec.ConditionalTask cannot be cast to org.ap

JDBC报错:Cannot find class: com.mysql.jdbc.Driver

Cause: java.lang.ClassNotFoundException: Cannot find class: com.kuang.pojo.User

Caused by: java.lang.ClassNotFoundException: Cannot find class: User