tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fran Varin <>
Date Thu, 01 Feb 2007 17:45:23 GMT

I'v looked at that link a thousand times. Unfortunately, we are brand new to
Tomcat and the documentation strikes us as a little obtuse. On the one hand
it "appears" that you can modify the server.xml file (which we have done)
and the the datasource and context will be defined globally. We tried
that...same error. 

It also, appears that you can define a "context.xml" in the web app, we
tried that...same error. What would really be helpful is a practical

Sorry, if I sound like I'm venting but, it seems that everything we try to
do with Tomcat ends up an adventure regardless of how simple it may seem. 


Pid-2 wrote:
> Fran Varin wrote:
>> Hi, 
>> We are in the process of trying to use Tomcat 5.5.20 to access an
>> existing
>> DB2 Database. Up until this point the application has been running under
>> WebSphere (We are trying to utilize Tomcat for testing purposes). In
>> WebSphere we can supply an IBM JNDI Factory Class named
>> "" as the
>> "Context.INITIAL_CONTEXT_FACTORY". We can then find our driver and all is
>> well. 
>> Clearly, in Tomcat the above mentioned class does not exist. I've been
>> all
>> over the place trying to find an equivalent class that is part of Tomcat.
>> It
>> boils down to my attempt at using
>> "". However, when I do I
>> receive
>> "javax.naming.NameNotFoundException: Name jdbc is not bound in this
>> Context:". 
>> I need to resolve this issue in order to move forward with using Tomcat
>> but,
>> cannot seem to find a good example that explains how to do this. I've
>> seen
>> the documents that loosely describe change server.xml and creating a
>> context.xml for the application. But, this seems like the wrong path
>> given
>> the way that we have always proceeded with creating DB connections. So,
>> it
>> has really just added to my confusion. 
>> Any help would be greatly appreciated, 
>> Fran 
> InitialContext initialContext = new InitialContext();
> Context rootContext = (Context) initialContext.lookup("java:comp/env");
> DataSource ds = (DataSource) rootContext.lookup("jdbc/Database");
> Assuming that you've configured a DataSource in server.xml.
> p
> ---------------------------------------------------------------------
> To start a new topic, e-mail:
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View this message in context:
Sent from the Tomcat - User mailing list archive at

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message