日期:2014-05-16  浏览次数:20432 次

数据库连接出错:java.lang.ClassNotFoundException: org.apache.commons.dbcp.
点击右边红色标题查看本文完整版:数据库连接出错:java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource

环境:tomcat4.1,j2sdk1.4.2_04,jakarta-struts-1.2.4
? 工具:eclipse2.1.3
? 系统:win2k,SQLserver200+SQL Server 2000 For JDBC 驱动程序
?
? struts-config.xml
?
? <data-sources>
? <data-source type="org.apache.commons.dbcp.BasicDataSource">
? <set-property property="driverClassName" value="com.microsoft.jdbc.sqlserver.SQLServerDriver" />
? <set-property property="url" value="jdbc:microsoft:sqlserver://localhost:1433;databasename=cims" />
? <set-property property="username" value="sa" />
? <set-property property="password" value="sa" />
? <set-property property="maxActive" value="10" />
? <set-property property="minActive" value="3" />
? <set-property property="maxWait" value="5000" />
? <set-property property="defaultAutoCommit" value="true" />
? <set-property property="defaultReadOnly" value="false" />
? </data-source>
? </data-sources>
?
? 错误:
? <data-sources>
? <data-source type="org.apache.commons.dbcp.BasicDataSource">
? <set-property property="driverClassName" value="com.microsoft.jdbc.sqlserver.SQLServerDriver" />
? <set-property property="url" value="jdbc:microsoft:sqlserver://localhost:1433;databasename=cims" />
? <set-property property="username" value="sa" />
? <set-property property="password" value="sa" />
? <set-property property="maxActive" value="10" />
? <set-property property="minActive" value="3" />
? <set-property property="maxWait" value="5000" />
? <set-property property="defaultAutoCommit" value="true" />
? <set-property property="defaultReadOnly" value="false" />
? </data-source>
? </data-sources>
?
? 2004/10/22 16:22:50 org.apache.commons.modeler.Registry loadRegistry
? 情?: Loading registry information
? 2004/10/22 16:22:50 org.apache.commons.modeler.Registry getRegistry
? 情?: Creating new Registry instance
? 2004/10/22 16:22:51 org.apache.commons.modeler.Registry getServer
? 情?: Creating MBeanServer
? 2004/10/22 16:22:52 org.apache.coyote.http11.Http11Protocol init
? 情?: Coyote HTTP/1.1をポ?ト8080で初期化
? Tomcat-Standalone を起?
? Apache Tomcat/4.1.24-LE-jdk14
? 2004/10/22 16:22:54 org.apache.struts.action.ActionServlet initModuleDataSources
? 致命的: org.apache.struts.action.DATA_SOURCE の初期化
? java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource
? at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1443)     


我的异常网推荐解决方案:java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource,http://www.aiyiweb.com/j2ee/182233.html