tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean Rowe <ichabo...@gmail.com>
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:

>Sean,
>
>  
>
>>--- Urspr√ľngliche Nachricht ---
>>Von: Sean Rowe <ichabooka@gmail.com>
>>An: Tomcat Users List <tomcat-user@jakarta.apache.org>
>>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 ...
>>conn.close();
>>
>>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
>>Context
>>
>>    
>>
>
>No. Did you look at
>http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-datasource-examples-howto.html?
>
>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.
>
>regards
>       Dirk
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message