Hi! I am developing a web application by using struts 2, hibernate 3, maven 2. I found an example that suggests using Spring to inject the sessionFactory to the dao and the example also suggests injecting this object:
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName"> <value>com.mysql.jdbc.Driver</value> </property> <property name="url"> <value> jdbc:mysql://localhost:3306/lider </value> </property> ..... </bean>
The thing is that when I try to load my application, I am getting this exception in console:
java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233) at org.springframework.util.ClassUtils.forName(ClassUtils.java:229) ......
I have defined in my pom.xml file the required dependency for that org.apache.commons.dbcp.BasicDataSource class:
<!-- Spring --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> <version>2.5.6</version> </dependency> <dependency> <groupId>commons-dbcp</groupId> <artifactId>commons-dbcp</artifactId> <version>1.2.2</version> </dependency>
The project does not have compilation problems, the only problem is when trying to load it...
Any ideas about this problem?
Thanks in advance!
|