You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ca...@usitc.gov on 2006/07/05 22:17:10 UTC

global JNDI environment entries on tomcat 5.5

I am trying to use JNDI to externalize some configuration properties in
a web application.  

These properties are strings and are environment specific.  Because they
are impacted by the environment the web application is deployed on, I do
not want to include them in the web.xml.

In reading the tomcat 5.5 JNDI instructions
(http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html) and
the mailing lists
(http://article.gmane.org/gmane.comp.jakarta.tomcat.user/72768/match=env
ironment+entry+5), it seems that creating <Environment> entries under
the <GlobalNamingResources> would be ideal for this.

Environment values should be accessible container wide and they don't
seem to require any reference in the web.xml file.

However, my application cannot find any environment entries defined
under GlobalNamingResources.  They can only be located if the
environment entries are defined for the applications context (e.g.
<Context><Environment/></Context>). 

I am using the standard "java:comp/env" name for looking up my env
context.  Is this incorrect for accessing global resources?

Please note:  I am using the tomcat admin web application for create the
jndi resources.

What am I missing?

Best regards,

Carlos

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: global JNDI environment entries on tomcat 5.5

Posted by Mark Thomas <ma...@apache.org>.
Carlos.Fernandez@usitc.gov wrote:
> What am I missing?
>From http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html
<quote>
Tomcat 5 maintains a separate namespace of global resources for the
entire server. These are configured in the <GlobalNameingResources>
element of $CATALINA_HOME/conf/server.xml. You may expose these
resources to web applications by using <ResourceLink> elements.
</quote>

You need to define ResourceLink elements for your context.

Mark

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org