Spring MVC-Hibernate error: BasicDataSource is not found

I created a spring mvc project using Spring Roo, with MySql database and Hibernate provider. The problem is that when I run it I get the following error:

java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource

Even in applicationContext.xml, I see a error message that org.apache.commons.dbcp.BasicDataSource is not found

<bean class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" id="dataSource">
        <property name="driverClassName" value="${database.driverClassName}"/>
        <property name="url" value="${database.url}"/>
        <property name="username" value="${database.username}"/>
        <property name="password" value="${database.password}"/>
        <property name="testOnBorrow" value="true"/>
        <property name="testOnReturn" value="true"/>
        <property name="testWhileIdle" value="true"/>
        <property name="timeBetweenEvictionRunsMillis" value="1800000"/>
        <property name="numTestsPerEvictionRun" value="3"/>
        <property name="minEvictableIdleTimeMillis" value="1800000"/>
        <property name="validationQuery" value="SELECT 1"/>

But in the pom created by Spring Roo I see the dependency for commons-dbcp, which is the jar that contains the missing class:


and in Maven Dependencies folder, I see file commons-dbcp-1.3.jar

Does anyone know why I'm getting the error?


I changed commons-dbcp version to 1.4 and commons-pool version to 1.4 (from 1.5.6) and also removed the exclusions part form the commons-dbcp dependency and it started to work. This are de dependencies now:

            <!-- <version>1.5.6</version> -->

Need Your Help

jQuery; click to show html content and countdown, and then additional content

php javascript jquery html

I wanted to create a link that would show content before showing a direct link on my forum.

Reading Data from CSV to Screen output

c# c++ c windows csv

This may not be allowed but I'll ask anyway.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.