Hello,
I would like to use DBCP to manage the pool connection.
1. If I execute the web application using DBCP, an exception occur:
java.lang.NoClassDefFoundError: org/apache/struts/legacy/GenericDataSource
...
2. So I put the struts-legacy.jar in the WEB-INF/lib of the application, another error occur when I am starting tomcat:
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:243)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:743)
...
Any idea?
Thanks.
The oracle JDBC driver classes12.jar, the common-pool/dbcp/collection are in the tomcat/common/lib directory
The configuration in the struts-config.xml:
<data-source key="ORACLE_EXP"
type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="driverClass" value="oracle.jdbc.driver.OracleDriver"/>
<set-property property="url" value="jdbc:oracle:thin:@XXX.XXX.XXX.XXXX:port:****"/>
<set-property property="removeAbandoned" value="true"/>
<set-property property="maxIdle" value="1"/>
<set-property property="maxActive" value="1"/>
<set-property property="maxWait" value="5000" />
<set-property property="username" value="****"/>
...