tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan Nesbitt" <>
Subject Cannot Solve "jdbc is not bound is this Context" problem
Date Sun, 17 Aug 2003 19:25:17 GMT
We have been trying for over a week to solve this problem. It doesn't help
that we haven't used tomcat before, but our application works fine on
WebSphere. So I guess that it some configuration that we are missing.
We are trying to configure tomcat (4.1.24) to do a jndi lookup of a
DataSource which is a db2 jdbc app driver.

The Tomcat server.xml had a sample jdbc configuration which was modified to
the following...

<Resource name="jdbc/SURESWIT" auth="Container"
<ResourceParams name="jdbc/SURESWIT">

The web.xml includes


The Java code performs the following :-

if (ds == null)
try {
       Context ctx = new InitialContext();
      ds = (javax.sql.DataSource) ctx.lookup(("jdbc/SURESWIT");
  catch (Exception e)
      logger.text( IRecordType.TYPE_ERROR_EXC,
                   "Naming service exception:" + e.toString());

When the above code runs it throws the following exception
init(ServletConfig) Naming service
Name jdbc is not bound in this Context

I have copied the DB2 jdbc driver file to $CATALINA_HOME/common/lib (I
copied it both as .zip and .tar as some web resources suggested tomcat would
only recognise it as .tar)

ANY and I mean ANY help would be greatly appreciated. Even if it's to say it
doesn't work with tomcat.

Many thanks Alan

View raw message