[main] WARN GenericApplicationContext:591 – Exception encountered during context initialization – cancelling refresh attempt: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name ‘dataSource’ defined in class path resource [.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource

This is an issue faced if you have not dbcp jars in your classpath.

For maven the simple fix is to add the dependency to the pom.xml


Commons dbcp 2 is also avaliable.


But for this make sure that you update config to use


Leave a Comment