tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phillip Qin <Phillip....@shareowner.com>
Subject RE: Difficulty connecting to DB2 for iSeries from Tomcat 5.0.28
Date Tue, 21 Dec 2004 18:39:07 GMT
What is the resourcelink in your context.xml?


-----Original Message-----
From: David Uctaa [mailto:ductaa@gmail.com] 
Sent: December 21, 2004 12:27 PM
To: tomcat-user@jakarta.apache.org
Subject: Re: Difficulty connecting to DB2 for iSeries from Tomcat 5.0.28


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 <ductaa@gmail.com> 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:
> http://www.itjungle.com/fhg/fhg060204-story01.html .   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: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


!DSPAM:41c85cd9295551913319955!

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message