tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean Rowe <>
Subject Re: jndi question
Date Mon, 22 Aug 2005 15:49:41 GMT
Hi Dirk,

Thanks again for responding.  I have tried putting this into it's own 
context file.  For my latest attempt, I have created the data source 
using the admin module, and it rewrote my server.xml file for me, so I'm 
assuming it's in there correctly.  No matter how I do it ( and i really 
have followed the directions in the link you gave me), I can't seem to 
get it to work.  I must be missing something, but I can't seem to find it.

Dirk Weigenand wrote:

>>--- Urspr√ľngliche Nachricht ---
>>Von: Sean Rowe <>
>>An: Tomcat Users List <>
>>Betreff: Re: jndi question
>>Datum: Mon, 22 Aug 2005 09:24:10 -0500
>>Thanks for responding Dirk.  I've practically memorized the 
>>documentation on the link you sent:
>>// Obtain our environment naming context
>>Context initCtx = new InitialContext();
>>Context envCtx = (Context) initCtx.lookup("java:comp/env");
>>// Look up our data source
>>DataSource ds = (DataSource)
>>  envCtx.lookup("jdbc/EmployeeDB");
>>// Allocate and use a connection from the pool
>>Connection conn = ds.getConnection();
>>... use this connection to access the database ...
>>Whenever I try this, here's what I get (which led me to trying it the way
>>I posted):
>>javax.naming.NameNotFoundException: Name java:comp is not bound in this
>No. Did you look at
>I recommend putting the context definition in its own content.xml. On
>redeploying my application tomcat wouldn't find the driver class anymore.
>Mind you not the class itself but the definition of what class to load.
>This problem was solved by putting the context into context.xml.
>       Dirk

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

View raw message