配置Struts连接池时遇到的一个问题

我在配置连接池的时候(用的是commons-dbcp-1.2.1),把MySQL的JDBC驱动包放在WEB-INF/lib目录下
Tomcat启动时报错,说是ClassNotFound “org.gjt.mm.mysql.Driver”
后来在tomcat-docs发现下面一段:

DBCP uses the Jakarta-Commons Database Connection Pool. It relies on number of Jakarta-Commons componenets:

  • Jakarta-Commons DBCP 1.0
  • Jakarta-Commons Collections 2.0
  • Jakarta-Commons Pool 1.0
These jar files along with your the jar file for your JDBC driver should be installed in $CATALINA_HOME/common/lib.
NOTE:Third Party drivers should be in jarfiles, not zipfiles. Tomcat only adds $CATALINA_HOME/common/lib/*.jar to the classpath.
NOTE: Do not install these jarfiles in your /WEB-INF/lib, or $JAVA_HOME/jre/lib/ext, or anywhere else. You will experience problems if you install them anyplace other than $CATALINA_HOME/common/lib.
发现学习Java在这些配置问题的细节上要纠缠好多时间,希望将来能变好些吧。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值