anthony.dodd wrote:

> Hi
> 
>     I've posted a solution see "Generic DataSource Resource Factory
> Available. JDBC Data Source" on the tomcat user maillist.
> 
> Tony
> 
Yes, but...


Like many others on this list, I too have been unable to get the std 
JNDI DataSource thingy working; as an interim measure, I implemented a 
workaround (which does at least work!), but I refuse to be defeated!

My understanding is that the standard naming factory wotsit is "Tyrex" - 
if I implement Anthony Dodd's offering, do I chuck out Tyrex?

My latest attempt is based on the suggestions offered by Les Hughes, 
which uses the Jakarta Commons DBCP, collections, and pool libraries. 
However, when I run my application, I get the (by now, all too familiar) 
following exception thrown:
2002-06-13 13:37:15 static: Error!
javax.naming.NamingException: Exception creating DataSource: 
org.hsql.jdbcDriver
         at 
org.apache.naming.factory.TyrexDataSourceFactory.getObjectInstance(TyrexDataSourceFactory.java:227)
         at 
org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:165)
         at 
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:835)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
         at 
org.apache.naming.SelectorContext.lookup(SelectorContext.java:183)
         at javax.naming.InitialContext.lookup(InitialContext.java:350)
         at com.terma.martin.drs.StaticPage.handleRequest(Unknown Source)
         at 
org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java:331)
         at 
org.apache.velocity.servlet.VelocityServlet.doGet(VelocityServlet.java:292)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)

It seems as though Tyrex is trying to use org.hsql.jdbcDriver, which I 
don't want - I'm using MySQL - or am I not interpreting the stack trace 
properly?

Here is the relevant part of server.xml:
<Resource name="jdbc/RadiationDB"
        auth="Container"
        type="javax.sql.DataSource"/>
<Resource-params name="jdbc/RadiationDB">
        <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>me</value>
        </parameter>
        <parameter>
         <name>password</name>
         <value>secret!</value>
        </parameter>
        <parameter>
         <name>driverClassName</name>
         <value>org.gjt.mm.mysql.Driver</value>
        </parameter>
        <parameter>
         <name>url</name>
         <value>jdbc:mysql://localhost/radiation</value>
        </parameter>
</Resource-params>

My configuration is:
Tomcat 4.0.4b1
mm.MySQL 2.0.12
latest DBCP from nightly build
mySQL 3.23.46

running on Mac OS X (10.1.5) JDK 1.3.1

All suggestions gratefully received!

Thanks,
Martin

PS Sorry about the length of the post :-(


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

Reply via email to