Forums Register Login
Struts, DBCP weird problem
I am trying to set up a database connection with Struts and DBCP (Commons Database Connection Pool) and keep getting this error:

type: Status report

message: Servlet action is not available

description: The requested resource (Servlet action is not available) is not available.

I've copied commons-dbcp-1.2.1.jar, commons-pool-1.2.jar, and mysql-connector-java-3.1.12-bin.jar into the LIB folders of Tomcat, restarted the server... Here is my struts-config.xml:

<data-source type="org.apache.commons.dbcp.BasicDataSource">
value="com.mysql.jdbc.Driver" />
value="jdbc:mysql://XXXX.pair.com/XXXX" />
value="XXXXXXX" />
value="XXXXXXX" />
value="10" />
value="5000" />
value="false" />
value="false" />
value="SELECT COUNT(*) FROM products" />

And yes, all the XXX is valid information..

Thank you!!!
My advice to anyone looking to set up your connection pooling through struts is simply this: Don't do it.

Since it is the Application server that is ultimately responsible for maintaining a connection pool, it makes sense to do it through your Application Server and to follow the specific instructions provided by the Application Server to set it up. Just look at the Tomcat documentation, and you will find an example for setting up a MYSQl Data Source.
Anderson gave himself the promotion. So I gave myself this tiny ad:
ScroogeXHTML 7.1 - RTF to HTML5 / XHTML converter

This thread has been viewed 780 times.

All times above are in ranch (not your local) time.
The current ranch time is
Feb 22, 2018 19:58:03.