RHEL Tomcat + DBCP = problems
843842Oct 27 2009 — edited Nov 5 2009Hello,
I know this is a pretty specific environment question but I'm kind of out of ideas here and I figure if the gurus who frequent this forum can't help me then I'll have to go to plan B.
The problem in a nutshell is this. I cannot get DBCP based connection pooling working with a Tomcat 5.5 install that was installed via RPM on a RHEL 5 box.
I have successfully set up DBCP based JNDI pools on Tomcat 4, 5, and 6 on Windows and Linux but always on installs that were done via downloads direct from the Tomcat site. I currently have a test project that is using the code from [http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html] and it works fine on two systems (Windows Vista and a Linux box) but it does not work on Tomcat that was installed from Red Hat.
Originally I was getting an error message along the lines of "Context?!? What's a context?"and a variety of ClassNotFound errors I made some changes (namely packaging up naming-factory-dbcp.jar in my WAR) and I got past that problem. However when looking up from the Context I am now getting the following error messages.
- when I test using the JSP with JSTL SQL scriptlets as in the example linked above I get "javax.servlet.ServletException: Unable to get connection, DataSource invalid: "java.sql.SQLException: No suitable driver found for MYNAME" replacing MYNAME with the appropriate name.
- when I test using a simple servlet that does each step of looking up the context and getting the datasource from that I get "Name java: is not bound in this Context" when I look up the context "java:/comp/env"
And both of those test work when I deploy the exact same WAR onto the other installations (Vista and hand-installed Tomcat).
When I googled this problem (at least the first set of problems) I found threads on Apache mailing lists basically saying "For the love of god don't use the RH install". Which isn't the most tremendous help. At this point that is my plan B. Because I can't afford to waste more time on this but it will be tricky because I will have to go through many headaches to be able to do that (self-install). But surely someone somewhere must have made this work? Right? (he asked hopefully)
At any rate if you have (or know someone who has) made Tomcat work properly with DBCP when installed via the red hat package please let me know how I am supposed to do this. Because I am out of ideas here.
Thank you for reading.