tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ross Fujii" <>
Subject Re: Tomcat 4.0.2 - MySQL Connection Pooling
Date Tue, 26 Feb 2002 05:59:29 GMT
Hello Michael,

Yesssssss, I just got it working this past evening!!!!!
I've been on it for a few days and have tried everything
I could think of.    =O

To install Tomcat 4.0.2 and get JNDI working, I used
the RPM found in the standard download area named
   - tomcat4-4.0.2-2.noarch.rpm

along with the dependent RPMs:
   - regexp-1.2-1.noarch.rpm
   - servletapi4-4.0.2-1.noarch.rpm
   - xerces-j-1.4.4-2.noarch.rpm

This should create the proper user for you and install
the proper init.d start/stop scripts.

I then replaced the tomcat4/ directory that the RPM
placed on my server with the jakarta-tomcat-4.0.2/
directory found in the GZip-TAR'd regular Tomcat
install base file named jakarta-tomcat-4.0.2.tar.gz
(e.g. non-RPM version) and configured JNDI as below
and things worked!!!   =)

I'm thinking that the proper libraries weren't installed
by the RPM or something in the install didn't go right???
Not sure what no-arch signifies in the RPMs above, but
maybe I was just using the wrong install????

I tried adding and replacing JARs, but I couldn't find
the right combo that would enable the JNDI resource.  It
was consistent as I couldn't create a mail JNDI resource
either.  If you replace the entire tomcat directory and
thus the proper JARs, you should get it working.....

Best regards,

From: Michael Donaghy <>
To: Ross Fujii <>
Subject: Re: Tomcat 4.0.2 - MySQL Connection Pooling
Date: 25 Feb 2002 23:31:02 -0500

By any chance do you have your problem working yet?  I think I've got a
problem very similar to yours that I've spent quite a few hours on.



On Fri, 2002-02-22 at 17:14, Ross Fujii wrote:
>I'm trying to setup JNDI connection pooling in Tomcat 4.0.2 to a MySQL 
>(v3.23.49) database.  I'm also running an Apache 1.3.20 AJP13 connector 
>(using mod_jk) if that makes a difference all on a RedHat Linux 7.2 server.
>The following is a snippet of the JNDI resource creation in server.xml:
>     <Host name="" debug="0" appBase="webapps/" 
>unpackWARs="true">         <Context path="/test" docBase="test" debug="1"   
>                reloadable="true" privileged="true">           <Resource 
>name="jdbc/TestDB" auth="Container"                     
>type="javax.sql.DataSource"/>           <ResourceParams name="jdbc/TestDB"> 
>             <parameter><name>user</name><value>root</value></parameter>
>     <parameter>               <name>driverClassName</name>        
><value></value>             </parameter>    
><parameter>               <name>driverName</name>               
><value>jdbc:mysql://localhost/menagerie</value>             </parameter>
>        </ResourceParams>
>The following is the corresponding web.xml:        <resource-ref>           
>  <res-ref-name>jdbc/TestDB</res-ref-name>            
><res-auth>Container</res-auth>        </resource-ref>
>The sample code that I'm using in a servlet to grab the connection is the 
>following:        //Get the pooled DB connection        Context initCtx = 
>new InitialContext();        Context envCtx = 
>(Context)initCtx.lookup("java:comp/env");        DataSource ds = 
>        //Connect to the DB data source and run a query        ....
>The exception that is being thrown is:
>        javax.naming.NamingException: Cannot create resource instance
>I was wondering if there is somemthing that I'm still missing???
>Some other notes: -- Have setup connection pooling to SQL 2000 DB on 
>Windows 2000    using Tomcat 4.0.2b1 with no problem. -- Have coded a 
>stand-alone application that works and is able    to connect to MySQL and 
>query the DB with no problems -- Have upgraded to the latest MySQL 2.0.11 
>Any help or advice would be greatly appreciated. Thanks in advance, --Ross
>To unsubscribe:   <> For 
>additional commands: <> Troubles 
>with the list: <>

Join the world’s largest e-mail service with MSN Hotmail.

To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message