tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: JNDI Q's
Date Fri, 01 Feb 2002 22:26:16 GMT

On Fri, 1 Feb 2002, Christian Cryder wrote:

> Date: Fri, 1 Feb 2002 09:29:49 -0700
> From: Christian Cryder <>
> Reply-To: Tomcat Users List <>
> To: Tomcat-User <>
> Subject: JNDI Q's
> Ok, I've searched through most of the docs now and I have some very basic
> JDNI specific questions:
> 1. Are there any parts of JNDI which are _not_ included with Tomcat 4.0.1?
> (ie. is there anything that still needs to be downloaded/installed
> separately?)

What's included is jndi.jar, to give you the basic "javax.naming" apis.
That's all you need to do internal-to-Tomcat things related to naming,
such as reading the contents of the JNDI InitialContext that Tomcat
provides for each webapp.

If you need to talk to non-Tomcat-provided resources (such as an LDAP
based directory server), you will need to download and install the
appropriate JNDI provider (which would include ldap.jar and
providerutil.jar in this particular case).

> 2. What exactly is the relationship between what gets defined in server.xml
> and a specific webapp's web.xml? In other words, I see how you define a JNDI
> resource in server.xml using <Resource> and <ResourceParams> -- as I
> understand it this makes a resource available to a particual context (ie.
> webapp). What then, is the purpose of also defining the resource using
> <resource-ref> in that app's web.xml file?

The basic docs on JNDI resources are included in the Tomcat docs webapp,
and available online at:

J2EE servers only define entries in your JNDI initial context for which
you declare references (resource-entry, resource-ref-entry, and so on) in
your web.xml file.  Tomcat is currently a little bit slipshod and lets you
see resources declared only in server.xml.  It shouldn't really do that.

> 3. Is there any way to define a JNDI resource just through the web.xml file
> (as opposed to using server.xml file?) When you change web.xml, you can only
> need to cycle the webapp; when you change server.xml you have to cycle the
> entire server, which I'd like to avoid.

There is no mechanism to declare resources themselves solely in web.xml --
you can only declare *references* to resources.

Tomcat currently does not support dynamically adding or removing resources
while it is running.  That would be a nice enhancement.

> 4. Is there anyway to use the Tomcat manager app to cycle the whole server?
> What's the best way to do this? (especially if Tomcat is running as an NT
> service!)

The manager app cannot do that.  You'll need to use "outside of Tomcat"
things to accomplish this restart (such as the usual stop and start
commands on NT services).

> Thanks,
> Christian


To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message