Steve, like Wendell said, you've got to put the context.xml file under that directory. And rename it to the context name.

It will only work from the META-INF directory when you are deploying a .war file.

On 03/16/2004 10:23 PM Steve Gums wrote:
Can I ask a quick question before I do that.  I had my context.xml file
separate, because I like that better, but it fails.  When I put that context
into the server.xml it worked.  I am trying it again right now to make sure
of this.  Am I mistaken to think the context.xml file goes into

I will post these files as requested in just a sec.

Thanks for your help.

-----Original Message-----
From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 2:07 PM
To: Tomcat Users List
Subject: Re: JDBC problems with MySQL

post the Resource & ResourceParams tags from your context for the webapp. State whether it's in a context.xml file, server.xml or whatever.

Perhaps we can spot something.


ps this email has got some weird font - my mail reader is up the creek at the mo'. sorry

On 03/16/2004 09:47 PM Steve Gums wrote:

Just an update.
I included a file, that works great on my webapp that is already running


an old system, and you can see the change I made, which allows the app to
run.  Not sure if this helps anyone.

package com.voast.vkey.utils;

import java.sql.*;
import javax.sql.*;
import javax.naming.*;

public class DBUtils {

public static Connection getConnection () throws Exception {

Connection con = null;
/* Trying to figure this error out. --Temp comment--
try {
Context ctx = new InitialContext();
if ( ctx == null ) {
throw new Exception ("No Context");
DataSource ds;
ds = (DataSource)ctx.lookup("java:comp/env/jdbc/VKEYDB");
if ( ds != null ) {
con = ds.getConnection ();
}//end ds != null
catch ( Exception e ) {
LoggerUtil.globalLog ("ERROR","exception occured: " + e.toString() );
throw (e);
try {
con = DriverManager.getConnection("jdbc:mysql://localhost/vkey",
catch (Exception e) {
LoggerUtil.globalLog ("DEBUG","exception occured: " + e.toString() );
throw (e);

return con;



-----Original Message-----
From: Steve Gums [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 10:57 AM
Subject: JDBC problems with MySQL


           I know there has been a bazillion messages about this.  I
searched the archives and couldn't find anything to solve my extremely
annoying issue.  It has to be something really simple but I just can't



My System:

Solaris 9

Tomcat 5.0.19

MySQL 4.0.18

Connector J 3.0.11

I have the connector J jar in the /usr/local/tomcat/common/lib dir.

I have basically copied the HOW-TO located at.


and my result is this.


Foo Not Connected Bar -1

I have tried everything I can think of.  I verified the database and the
user/password combo.  Works good.  I even created a simple Java app that
connects and performs queries, which worked.  That would indicate


is cool with the Connector J.  I have verified that the jdbc/TestDB is in
the context and it is.  As best I can tell ds (DataSource) is coming back
not null, but the call to getConnection is failing.  I created a little


verbose web app and get the following message.

org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
class '' for connect URL 'null', cause: No suitable driver

This has to be something simple, because this works fine on my old


I know I am forgetting some small step that I did the first time and


to do again. Trust me I have checked the configs about a million times,


can't find any differences. Any help would be appreciated.

Sorry to be so vague here, but this is really simple. I don't know what


to include for info.

Steve Gums


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

struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian

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

Reply via email to