You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Christian Cryder <ch...@granitepeaks.com> on 2002/02/01 17:29:49 UTC

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?)

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?

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.

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!)

Thanks,
Christian
----------------------------------------------
Christian Cryder [christianc@atmreports.com]
Internet Architect, ATMReports.com
Barracuda - http://barracuda.enhydra.org
----------------------------------------------
 "What a great time to be a(n employed) Geek"


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: JNDI Q's

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Fri, 1 Feb 2002, Christian Cryder wrote:

> Date: Fri, 1 Feb 2002 09:29:49 -0700
> From: Christian Cryder <ch...@granitepeaks.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: Tomcat-User <to...@jakarta.apache.org>
> 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:

  http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-howto.html

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

Craig


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>