GenericObjectPool java.lang.NoClassDefFoundError

启动myeclipse工程后

MyEclipse6.0控制台下的错误提示:

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool

Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool

at java.lang.Class.getDeclaredConstructors0(Native Method)

at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)

at java.lang.Class.getConstructor0(Class.java:2671)

at java.lang.Class.getDeclaredConstructor(Class.java:1953)

 

<bean id="mysqldb"  class="org.apache.commons.dbcp.BasicDataSource">

 

虽然配置文件里用的是dbcp连接池  但使用过程中要导入commons-pool包才能好使,非常奇怪,按说这两个连接池应该是相互独立的,还不知道为什么用dbcp连接池时要用commons pool的包。

 

参考:http://ethip.iteye.com/blog/237119

你可能感兴趣的:(java,apache,bean,xml,MyEclipse)