tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Uctaa <>
Subject Re: Difficulty connecting to DB2 for iSeries from Tomcat 5.0.28
Date Tue, 21 Dec 2004 17:26:34 GMT
No matter what i do, the JNDI lookup is returning null.  What causes a
JNDI lookup to return null when the resource is defined in the
<GlobalNamingResources> section of server.xml?  Should I put the
resources into <NamingResources> in my context.xml?

On Mon, 20 Dec 2004 13:52:29 -0500, David Uctaa <> wrote:
> I am running Tomcat 5.0.28 on Win XP SP1.  We have DB2 running on 2
> iSeries servers.  When I attempt to look up a DataSource from JNDI to
> get a connection from it, the JNDI lookup is returning null.
> I am using IBM's JTOpen library for the JDBC drivers, and I am
> attempting to use Tomcat to manage the connection pooling.  I am
> following the instructions I saw listed here:
> .   I am trying the
> first option, using the Commons DBCP connection pool.
> I have attached copies of my server.xml and the context configuration
> file webappname.xml.  The code I am using to access the data source is
> pretty generic:
> Context initCtx = new InitialContext();
> Context ctx = (Context) initCtx.lookup("java:comp/env");
> DataSource ds = (DataSource) ctx.lookup("jdbc/myFirstDataSource");
> Connection conn = ds.getConnection();
> It turns out the that ctx.lookup call is returning null, as if it
> can't find the JNDI resource, and I can't figure out what I have
> misconfigured.
> Any and all help will be greatly appreciated.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message