I am using 

Tomcat 4.1.2
mm.mysql-2.0.14-bin.jar

it is difficult for me to find the version info on commons-dhcp and commons-pool, any 
hint on this would help.

I guess I am a little frustrated with all the version dependencies, no one to gripe at 
really, just venting.

THANKS TO ALL!


clay




-----Original Message-----
From:   Jacob Kjome [SMTP:[EMAIL PROTECTED]]
Sent:   Monday, July 08, 2002 1:03 AM
To:     Tomcat Users List
Subject:        RE: Connection Pooling?

Try this with Either Tomcat-4.1.3 which I've tested with the instructions 
at the link below and know it to work.  Also, you might try Tomcat-4.1.7 
whch just came out.  I had tried Tomcat-4.1.6 and it failed so, presumably, 
the nightly builds around the time of 4.1.6 development were broken as far 
as DBCP goes which is, likely, the reason why you are getting the bad behavior.

Jake

At 01:40 PM 7/4/2002 -0400, you wrote:
>Thanks for the help!
>
>I followed the steps in the howto page
>http://marc.theaimsgroup.com/?l=tomcat-user&m=102225547106556&w=2
>
>I compiled my java test file and there is no error message. But when I run
>it, I run it, I got the error message as below.Could anyone please give me
>some hints? Thanks a lot!
>
>javax.naming.NoInitialContextException: Need to specify class name in
>environment or system property, or as an applet parameter, or in an
>application resource file:  java.naming.factory.initial
>         at
>javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:647)
>         at
>javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
>         at
>javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284)
>         at javax.naming.InitialContext.lookup(InitialContext.java:351)
>         at org.ibiblio.pool.DataSourceBean.main(DataSourceBean.java:24)
>
>More detail below:
>
>1. My system already has these installed:
>jakarta-tomcat-4.0.1
>J2SE 1.3
>mysql-3.23.33
>mm.mysql-2.0.7
>
>2. I download Jakarta-Commons projects
>DBCP     Nightly Build 20020620. (The Nightly Build 20020523  couldn't be
>found).
>collections 2.0
>pool        1.0
>
>I put the mm.mysql, DBCP, collection and pool jar files into
>CATALINA_HOME/common/lib
>
>3.  I already have a DB called osprey in mySQL.
>
>4. Then I configured the context in the server.xml:
>
><Context path="/osrt/osprey/webapps"
>docBase="/public/html/osrt/osprey/webapps"
>                 debug="0"
>                 reloadable="true">
>
>            <Logger className="org.apache.catalina.logger.FileLogger"
>               prefix="localhost_DBTest_log." suffix=".txt"
>               timestamp="true"/>
>
>            <Resource name="jdbc/ospreyDb" auth="Container"
>                     type="javax.sql.DataSource"/>
>           <ResourceParams name="jdbc/ospreyDb">
>
>             <parameter>
>              <name>factory</name>
>              <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
>             </parameter>
>
><parameter><name>maxActive</name><value>100</value></parameter>
>
><parameter><name>maxIdle</name><value>30000</value></parameter>
>             <parameter><name>maxWait</name><value>100</value></parameter>
>
>             <parameter><name>user</name><value>****</value></parameter>
>             <parameter><name>password</name><value>***</value></parameter>
>             <parameter><name>driverClassName</name>
>               <value>org.gjt.mm.mysql.Driver</value></parameter>
>             <parameter><name>driverName</name>
>
><value>jdbc:mysql://trance.metalab.unc.edu:3306/osprey</value></parameter>
>           </ResourceParams>
>
>         </Context>
>
>5. I changed my WEB-INF/ web.xml by adding the <resource-ref> stuff.
>
><?xml version="1.0" encoding="ISO-8859-1"?>
>
><!DOCTYPE web-app
>     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>     "http://java.sun.com/dtd/web-app_2_3.dtd";>
>
><web-app>
>
>  <taglib>
>   <taglib-uri>
>    /orataglib
>   </taglib-uri>
>   <taglib-location>
>    /WEB-INF/tlds/orataglib_1_0_3.tld
>   </taglib-location>
>  </taglib>
>
><resource-ref>
>       <res-ref-name>jdbc/ospreyDb</res-ref-name>
>       <res-type>javax.sql.DataSource</res-type>
>       <res-auth>Container</res-auth>
>       <res-sharing-scope>Shareable</res-sharing-scope>
></resource-ref>
>
></web-app>
>
>6. I have a java file in WEB-INF/classes/org/ibiblio/pool call
>DataSourceBean.java
>
>//Testing
>package org.ibiblio.pool;
>
>import java.lang.*;
>import java.io.*;
>import java.sql.*;
>import javax.sql.*;
>import java.util.*;
>import javax.naming.*;
>import javax.naming.spi.*;
>
>public class DataSourceBean{
>        public static void main (String arg[])
>        {
>            try{
>               Context ctx = new InitialContext();
>               if(ctx == null ) throw new Exception("Boom - No Context");
>               DataSource ds
>=(DataSource)ctx.lookup("java:comp/env/jdbc/ospreyDb");
>
>             } catch(Exception e) {
>             e.printStackTrace();
>             }
>
>        }//end of main
>
>} // end of class
>
>The error is from the line
>  DataSource ds =(DataSource)ctx.lookup("java:comp/env/jdbc/ospreyDb");
>
>
>
>
>
>On Thu, 4 Jul 2002, Les Hughes wrote:
>
> > I think I should set up a cron job to email this link out every day....
> >
> > http://marc.theaimsgroup.com/?l=tomcat-user&m=102225547106556&w=2
> >
> >
> >
> > > -----Original Message-----
> > > From: Meichun Li [mailto:[EMAIL PROTECTED]]
> > > Sent: 04 July 2002 13:09
> > > To: Tomcat Users List
> > > Subject: Connection Pooling?
> > >
> > >
> > > Hi,
> > > I want to implement my application with Connection Pooling.
> > >
> > > Tomcat offers supports of a connection pool for JDBC
> > > connection, but there
> > > should be a prerequisite--JDBC driver should provide pooled
> > > datasource
> > > implementation. Is this right?
> > >
> > > The JDBC driver for MySQL database I am using is
> > > org.gjt.mm.mysql. The
> > > driver has the class MysqlDataSource that is a JNDI DataSource for
> > > Mysql JDBC connection-- only the basic
> > > implementation of javax.sql.Datasource but not connection pool
> > > implementation.
> > >
> > > Is this means that I can't  use connection pool with this
> > > JDBC driver in
> > > tomcat?
> > >
> > > Thanks!
> > >
> > > Meichun
> > >
> > >
> > > --
> > > Meichun Li
> > > Ibiblio.org
> > > 919-962-5646
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
> > >
> >
> > --
> > To unsubscribe, 
> e-mail:   <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> >
>
>--
>Meichun Li
>Ibiblio.org
>919-962-5646
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to