tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Williamson" <ja...@nameonthe.net>
Subject Re: Tyrex/Warp JDBC NamingContext problem
Date Fri, 05 Apr 2002 14:58:12 GMT
Works fine for me on a dev box using mysql, here's a snip from my server.xml
file:

 <Host name="nameon" appBase="/usr/local/nameondev >
        <Context path="" docBase="dating" debug="0">
 <Resource name="jdbc/nameondev"
  auth="SERVLET"
  type="javax.sql.DataSource"/>
 <ResourceParams name="jdbc/nameondev">
   <parameter>
  <name>user</name>
  <value>nameondev</value>
   </parameter>
   <parameter>
  <name>password</name>
  <value>secret</value>
   </parameter>
   <parameter>
  <name>driverClassName</name>
  <value>org.gjt.mm.mysql.Driver</value>
   </parameter>
   <parameter>
  <name>driverName</name>
  <value>jdbc:mysql://localhost:3306/nameondev</value>
   </parameter>
 </ResourceParams>
 </Context>

And here's a snip from the context's web.xml file:

<resource-ref>
  <description>nameon dev database</description>
  <res-ref-name>jdbc/nameondev</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <res-auth>Container</res-auth>
</resource-ref>

As for the Warp thing I suspect that I know what's going on (and I think
your problems are entirely unrelated),
due to how the WarpConnector is configured it doesn't find your original
deployed webapp with all the
resources you've specified but it realises it needs a webapp so it creates a
new one with the default resources (aka
non) configured. It's all to do with the WebAppDeploy directive and the
context entry in the server.xml
because the connector completely ignores the

WebappDeploy context_name Conn /
                         ^^^^^^^^^^^
bit but looks at the '/' section to see if it can find a matching context
within Tomcat. Send your server.xml file and httpd.conf file and I can tell
you what's going wrong.

Regards,

James Williamson
www.nameonthe.net


> Jakarta Tomcat Newsgroup (@Basebeans.com) wrote:
>
> > Subject: Tyrex/Warp JDBC NamingContext problem
> > From: "Hermod Opstvedt" <hermod.opstvedt@dnb.no>
> >  ===
> > Hi all
> >
> > I have looked all over the place, and come across several people that
are
> > experiencing the same as me. When I access my .jsp's directly to TC, a
> > lookup of the JDBC that I configured in server.xml works fine. When
starting
> > up Apache and hence warp, it stops working. I have stepped through it,
and
> > confirmed that the JDBC entry is in the naming context, but the cast
> > (through Tyrex) doesn't seem to work so it returns null. Hasn't anybody
come
> > across a solution for this ?
> >
>
>
> My situation is slightly different, in that I'm using servlets+Velocity,
> and a standalone Tomcat 4.0.4b1, but I think we have the same problem: I
> can connect successfully to MySQL using mm.mysql JDBC driver, but
> configuring a Datasource using JNDI following the HOW-TO always results
> in a null pointer being returned from the lookup("jdbc/..."). I suspect
> that Tyrex is broken; when I set the debug level to 99, I get an entry
> in catalina.out to the effect that Tyrex could not find the hypersonic
> driver - not surprisingly, since I don't have it or want it. Looking at
> the Tyrex source reveals that the hypersonic thing is a hard-coded
> default, which I suppose gets replaced by the name of the driver you
> configure in the server.xml parameters.
>
> My question is this: is ANYBODY successfully connecting to any database
> other than this hypersonic thingy? If so, what JDBC driver are you
> using? Did you have to 'tweak' the configuration given in the HOW-TO?
>
> Help please!
>
> Martin
>
>
> --
> To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
> Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
>


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message