RE: Configuring System properties

2003-02-07 Thread Shapira, Yoav
Howdy,
If you want to go the same route, simply add -Dsearcher.home=... to the
JAVA_OPTS variable in $CATALINA_HOME/bin/catalina.sh.  It will be
available via System.getProperty(searcher.home) just like when you
launch a command-line application.

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Sreedhar, Dantam [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 07, 2003 7:53 AM
To: Tomcat Users List
Subject: Configuring System properties

Hi,

I am using  Java Web Services Developer Pack to expose methods using
SOAP.
The problem is I want to read a property file location in my program.
If
the
program is of application type, this can be implemented by setting
system
property using -D searcher.home =  command line argument.

My question is, how to set system property in tomcat (and application
using
SOAP in particular java web services developer pack)?

Any help on this is highly appreciated.

Thanks,
-Sreedhar


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Configuring System properties

2003-02-07 Thread Will Hartung
 From: Shapira, Yoav [EMAIL PROTECTED]
 Sent: Friday, February 07, 2003 6:02 AM
 Subject: RE: Configuring System properties


 Howdy,
 If you want to go the same route, simply add -Dsearcher.home=... to the
 JAVA_OPTS variable in $CATALINA_HOME/bin/catalina.sh.  It will be
 available via System.getProperty(searcher.home) just like when you
 launch a command-line application.

Perfectly valid and reasonable solution, though it requires folks using your
app to tweak the startup command (most containers allow this).

Another option is to simply set the property yourself in a startup servlet
using System.setProperty(). Then, you can configure it in your web.xml using
a configuration option or a JNDI entry.

This does bring up a simple question:

Do all of the webapps see the same System Properties? I can't imagine why
not (assuming they share a JVM), but with all  of the isolation that's
enforced between the webapps, it gives one pause to consider.

Regards,

Will Hartung
([EMAIL PROTECTED])




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Configuring System properties

2003-02-07 Thread Craig R. McClanahan


On Fri, 7 Feb 2003, Will Hartung wrote:


 Do all of the webapps see the same System Properties?

Yes, if they're running in the same JVM.

 I can't imagine why
 not (assuming they share a JVM), but with all  of the isolation that's
 enforced between the webapps, it gives one pause to consider.


That's why system properties are not a very good approach to configuring
per-webapp behavior.  However, they are convenient in standalone apps.

An example approach that works pretty well for webapps and for standalone
apps sharing the same code is to use a graduated search mechanism for
configuration info -- like what the commons-logging package does in
looking for logging configuration:  look for a local properties file with
a well known name, look for a JAR file that has the right file in its
META-INF directory, look at a system property, fall back to a default.

 Regards,

 Will Hartung
 ([EMAIL PROTECTED])


Craig

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]