tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mufaddal Khumri" <MKhu...@allegromedical.com>
Subject RE: Setting an environment variable in tomcat 5.5 service?
Date Wed, 11 May 2005 16:26:53 GMT
Thank you for the reply. I am trying to set in web.xml using:

  <env-entry>
    <env-entry-name>MY_ENV_VAR</env-entry-name>
    <env-entry-value>C:/config/one.xml</env-entry-value>
    <env-entry-type>java.lang.String</env-entry-type>
  </env-entry>

I am placing this right above the </web-app> ending tag.

My environment variable is not being set. I check this by printing out
all the environment variables from my webapp:
	...
	...
    Map env = System.getenv();
    Iterator it = new TreeSet(env.keySet()).iterator();
       ...
    ....

Any clues as to why my <env-entry> is not taking effect?

Thanks,

-----Original Message-----
From: Lutz Zetzsche [mailto:Lutz.Zetzsche@sea-rescue.de] 
Sent: Tuesday, May 10, 2005 2:01 PM
To: Tomcat Users List
Subject: Re: Setting an environment variable in tomcat 5.5 service?

Hi Mufaddal,

Am Dienstag, 10. Mai 2005 21:33 schrieb Mufaddal Khumri:
> I have Tomcat 5.5 running as a service on Windows XP. Where in Tomcat
> can I set an environment variable?
>
> I can set an environment variable by going to Control Panel -> System
> -> Advanced -> Environment variables, but I want to do it in
> Catalina.sh or equivalent.
>
> In my Tomcat/bin folder I have got: bootstrap.jar,
> commons-logging-api.jar, tomcat5.exe, tomcat5w.exe. I do not see a
> Catalina.sh or equivalent.

You have different options where to set environment variables. Choosing 
the right place for your variable declaration depends on your 
intention.

You can set environment variables here:

1.
In $CATALINA_HOME/conf/server.xml,
using the Environment element nested inside the GlobalNamingResources 
element:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/globalresources.h
tml

2.
In context files in different places, i.e. 
$CATALINA_HOME/conf/context.xml or 
$CATALINA_HOME/conf/[enginename]/[hostname]/[webappname].xml,
using the Environment element nested inside the Context element:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html#Envi
ronment%20Entries

3.
In $CATALINA_HOME/webapps/[webappname]/WEB-INF/web.xml, like 
demonstrated here:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html#Envi
ronment%20Entries


Best wishes

Lutz

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


------------------------------------------------------------------------------------------
This email and any files transmitted with it are confidential 
and intended solely for the use of the individual or entity 
to whom they are addressed. If you have received this 
email in error please notify the system manager. Please
note that any views or opinions presented in this email 
are solely those of the author and do not necessarily
represent those of the company. Finally, the recipient
should check this email and any attachments for the 
presence of viruses. The company accepts no liability for
any damage caused by any virus transmitted by this email.
Consult your physician prior to the use of any medical
supplies or product.
------------------------------------------------------------------------------------------


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