|
在使用dbutils时找不到import org.apache.commons.dbcp.BasicDataSource;
原因:没有导入commons-dbcp.Jar包
严重: Servlet.service() for servlet action threw exception
java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool
at org.apache.commons.dbcp.BasicDataSourceFactory.createDataSource(BasicDataSourceFactory.java:152)
at org.apache.commons.dbutils.ApplicationConnSource.init(ApplicationConnSource.java:74)
at org.apache.commons.dbutils.ApplicationConnSource.getConnection(ApplicationConnSource.java:40)
at service.ImageService.addMsg(ImageService.java:36)
at action.ImageAction.execute(ImageAction.java:40)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
原因是工具myEclipse在建立项目的时候,少加一个包 commons-pool-1.3.jar
补上去问题解决。 |
|