A question that is encountered when configuring the Struts connection pool

xiaoxiao2021-03-06  43

When I configure the connection pool (with commons-dbcp-1.2.1), put the mysql's JDBC driver package in a web-inf / lib directory.

Tomcat starts the error, saying is ClassNotFound "Org.gjt.mm.mysql.driver"

Later, I found below in Tomcat-DOCS:

DBCP Uses The Jakarta-Commons Database Connection Pool. It Relies on Number of Jakarta-Commons Componsenets:

JAKARTA-Commons DBCP 1.0 Jakarta-Commons Collections 2.0 Jakarta-Commons Pool 1.0

Thase 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..

I found that learning Java should be entangled for many times on the details of these configuration issues, I hope to get better in the future.

转载请注明原文地址:https://www.9cbs.com/read-112434.html

New Post(0)