This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Cloud Application Architecture Patterns: Designing, Building, and Modernizing for the Cloud and have Kyle Brown, Bobby Woolf and Joseph Yodor on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Struts, DBCP weird problem

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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-sources>
<data-source type="org.apache.commons.dbcp.BasicDataSource">
<set-property
property="driverClassName"
value="com.mysql.jdbc.Driver" />
<set-property
property="url"
value="jdbc:mysql://XXXX.pair.com/XXXX" />
<set-property
property="username"
value="XXXXXXX" />
<set-property
property="password"
value="XXXXXXX" />
<set-property
property="maxActive"
value="10" />
<set-property
property="maxWait"
value="5000" />
<set-property
property="defaultAutoCommit"
value="false" />
<set-property
property="defaultReadOnly"
value="false" />
<set-property
property="validationQuery"
value="SELECT COUNT(*) FROM products" />
</data-source>
</data-sources>


And yes, all the XXX is valid information..

Thank you!!!
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic