Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to set new Tomcat Environment variable?

843840Feb 13 2003 — edited Feb 17 2003
I have an imported class used by my servlet that is supposed to look for an environment variable like "xxx.app.logdir". I'm having trouble setting it in Tomcat. I have tried the following (stopping and starting Tomcat with each change):

1) In \conf\server.xml file, adding under <GlobalNamingResources>
<Environment name="simpleValue" type="java.lang.Integer" value="30"/>
<Environment name="xxx.app.logdir" type="java.lang.String" value="C:\\Tomcat-4-1\\logs"/>
2) In my app's web.xml file
<env-entry>
  <env-entry-name>xxx.app.logdir</env-entry-name>
  <env-entry-value>C:\\Tomcat-4-1\\logs</env-entry-value>
  <env-entry-type>java.lang.String</env-entry-type>
</env-entry> 
3) In my \bin\startup.bat file
set xxx.app.logdir=C:\\Tomcat-4-1\\

4) On my PC's Environment variables.

Nothing has worked. In my code I have the lines
logMsg("System.getProperty('mmm.app.logdir')=" + 
 System.getProperty("xxx.app.logdir"));
logMsg("System.getProperty('simpleValue')=" + 
 System.getProperty("simpleValue")); 
with the output :
System.getProperty('xxx.app.logdir')=null
System.getProperty('simpleValue')=null 
I've searched forums and the Tomcat docs, but no luck. Any ideas?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 17 2003
Added on Feb 13 2003
8 comments
2,099 views