Deploy a Web service with system properties

2004-03-04 Thread Quinn Cao
Could someone give me some help on this?

I have a service which is started up with the system
properties as following:

java -DLogFileDir=c:\test\logs -DDataSource=MyDataSource com.bambi.MyService

Now I need to convert the above service into a web service by using soap
under Tomcat. My question is: How do I specify the system properties when
I deploy the service in soap?


Thanks.

Quinn


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



RE: Deploy a Web service with system properties

2004-03-04 Thread Shapira, Yoav

Hi,
You can at any point in any of your classes use
System.setProperty(LogFileDir, c:\test\logs)...

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Quinn Cao [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 04, 2004 10:10 AM
To: [EMAIL PROTECTED]
Subject: Deploy a Web service with system properties

Could someone give me some help on this?

I have a service which is started up with the system
properties as following:

java -DLogFileDir=c:\test\logs -DDataSource=MyDataSource
com.bambi.MyService

Now I need to convert the above service into a web service by using
soap
under Tomcat. My question is: How do I specify the system properties
when
I deploy the service in soap?


Thanks.

Quinn


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




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Deploy a Web service with system properties

2004-03-04 Thread Quinn Cao
Thanks.

-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 04, 2004 9:15 AM
To: Tomcat Users List
Subject: RE: Deploy a Web service with system properties



Hi,
You can at any point in any of your classes use
System.setProperty(LogFileDir, c:\test\logs)...

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Quinn Cao [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 04, 2004 10:10 AM
To: [EMAIL PROTECTED]
Subject: Deploy a Web service with system properties

Could someone give me some help on this?

I have a service which is started up with the system
properties as following:

java -DLogFileDir=c:\test\logs -DDataSource=MyDataSource
com.bambi.MyService

Now I need to convert the above service into a web service by using
soap
under Tomcat. My question is: How do I specify the system properties
when
I deploy the service in soap?


Thanks.

Quinn


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




This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential, proprietary
and/or privileged.  This e-mail is intended only for the individual(s) to
whom it is addressed, and may not be saved, copied, printed, disclosed or
used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the
sender.  Thank you.


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



Setting system properties in standalone Tomcat 4.1.24

2004-01-26 Thread Chris Ward
Hi all,

Sorry if this is a really dumb question, but how/where do I
set system properties when using Tomcat 4.1.24?  I've searched
around but found nothing obvious.

Is it in an xml file rather than a .properties file?
Is it in the Java JDK?


Best regards
Chris


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



RE: Setting system properties in standalone Tomcat 4.1.24

2004-01-26 Thread Rudolf Visagie
If by system properties you mean JVM (Java Virtual Machine) settings, then
you can do this by setting
the CATALINA_OPTS variable in the catalina.sh (unix, linux) or catalina.bat
(win32) file in the /bin directory of your
Tomcat installation.

-Original Message-
From: Chris Ward [mailto:[EMAIL PROTECTED]
Sent: Monday, January 26, 2004 3:47 PM
To: Tomcat Users List
Subject: Setting system properties in standalone Tomcat 4.1.24


Hi all,

Sorry if this is a really dumb question, but how/where do I
set system properties when using Tomcat 4.1.24?  I've searched
around but found nothing obvious.

Is it in an xml file rather than a .properties file?
Is it in the Java JDK?


Best regards
Chris


-
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: Setting system properties in standalone Tomcat 4.1.24

2004-01-26 Thread Chris Ward
Thanks.  That's just what I needed.  I thought I'd done it at some
point in the past!

Best regards
Chris


 If by system properties you mean JVM (Java Virtual Machine) 
 settings, then you can do this by setting the CATALINA_OPTS 
 variable in the catalina.sh (unix, linux) or catalina.bat
 (win32) file in the /bin directory of your
 Tomcat installation.

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



Re: classpath issues and system properties

2003-08-21 Thread Bill Barker

srinivas reddy [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,
 I am using tomcat 4.1.24. I have a couple of
 questions.

 1. Online documentation about class loader says,
 System class loader operates on CLASSPATH. I have
 included j2ee.jar in my CLASSPATH, but tomcat is not
 picking it up. Why is it so?

Wherever you saw these docs, they are wrong.  Tomcat ignores the CLASSPATH
variable.  And, in any case, trying to use j2ee.jar with Tomcat is pure evil
;-).  Just install the components that you need, and you may finish your
project in finite time :).


 2. When I use tomcat, system property
 java.naming.factory.initial is initialized to
 org.apache.naming.java.javaURLContextFactory. Where
 did the system pick this property from? How can I
 override this setting? I initialized JNDI context with
 environment having java.naming.factory.initial as
 com.sun.enterprise.naming.SerialInitContextFactory
 but ultimately
 org.apache.naming.java.javaURLContextFactory is set
 to java.naming.factory.initial. How can I avoid
 this?

I don't believe that you can avoid it (without looking more deeply into the
code than I care to do at the moment).  And, even if you could, the likely
result is that Tomcat would lay on it's back, point it's toes in the air,
and die.


 I would appreciate if anybody can help me with these
 issues. I am really struggling for a week.

 tia,
 Srinivas

 =
 I am not afraid of losing. But I don't like it.

 __
 Do you Yahoo!?
 Yahoo! SiteBuilder - Free, easy-to-use web site design software
 http://sitebuilder.yahoo.com




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



Re: classpath issues and system properties

2003-08-21 Thread srinivas reddy

--- Bill Barker [EMAIL PROTECTED] wrote:
 
 srinivas reddy [EMAIL PROTECTED] wrote
 in message

news:[EMAIL PROTECTED]
  Hi,
  I am using tomcat 4.1.24. I have a couple of
  questions.
 
  1. Online documentation about class loader says,
  System class loader operates on CLASSPATH. I have
  included j2ee.jar in my CLASSPATH, but tomcat is
 not
  picking it up. Why is it so?
 
 Wherever you saw these docs, they are wrong.  Tomcat
 ignores the CLASSPATH
 variable. 

I found this documentation at
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html.
Did I misunderstand it or it says what I am thinking?
 And, in any case, trying to use j2ee.jar
 with Tomcat is pure evil
 ;-).  Just install the components that you need, and
 you may finish your
 project in finite time :).


Why is using j2ee.jar with tomcat is not recommended?
Is there any resource explaining what can go wrong? 

 
  2. When I use tomcat, system property
  java.naming.factory.initial is initialized to
  org.apache.naming.java.javaURLContextFactory.
 Where
  did the system pick this property from? How can I
  override this setting? I initialized JNDI context
 with
  environment having java.naming.factory.initial
 as
 
 com.sun.enterprise.naming.SerialInitContextFactory
  but ultimately
  org.apache.naming.java.javaURLContextFactory is
 set
  to java.naming.factory.initial. How can I avoid
  this?
 
 I don't believe that you can avoid it (without
 looking more deeply into the
 code than I care to do at the moment).  And, even if
 you could, the likely
 result is that Tomcat would lay on it's back, point
 it's toes in the air,
 and die.
 
 
  I would appreciate if anybody can help me with
 these
  issues. I am really struggling for a week.
 
  tia,
  Srinivas
 
  =
  I am not afraid of losing. But I don't like it.
 
  __
  Do you Yahoo!?
  Yahoo! SiteBuilder - Free, easy-to-use web site
 design software
  http://sitebuilder.yahoo.com
 
 
 
 

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


=
I am not afraid of losing. But I don't like it.

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



RE: classpath issues and system properties

2003-08-21 Thread Shapira, Yoav

Howdy,

I found this documentation at
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html
.
Did I misunderstand it or it says what I am thinking?

You misunderstood it.

Why is using j2ee.jar with tomcat is not recommended?

Because it contains duplicate older versions of certain APIs included
and required for tomcat, most especially the servlet API.

Is there any resource explaining what can go wrong?

Yes, this list's archives.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



Re: classpath issues and system properties

2003-08-21 Thread Justin Ruthenbeck
At 08:48 AM 8/21/2003, you wrote:
  1. Online documentation about class loader says,
  System class loader operates on CLASSPATH. I have
  included j2ee.jar in my CLASSPATH, but tomcat is
 not
  picking it up. Why is it so?

 Wherever you saw these docs, they are wrong.  Tomcat
 ignores the CLASSPATH
 variable.
I found this documentation at
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html.
Did I misunderstand it or it says what I am thinking?
What it says is that the System Classloader loads classes from the 
classpath.  This is true.  HOWEVER, Tomcat out-of-the-box ignores whatever 
you set for the CLASSPATH env variable and builds it from scratch in it's 
stratup scripts.  This behavior was not an accident in Tomcat's 
development.  Don't mess with it unless you're fully aware of why and how 
Tomcat's classloaders work the way they do.

STFA for more info on this.

justin


Justin Ruthenbeck
Software Engineer, NextEngine Inc.
justinr - AT - nextengine DOT com
Confidential
   See http://www.nextengine.com/confidentiality.php

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


classpath issues and system properties

2003-08-20 Thread srinivas reddy
Hi,
I am using tomcat 4.1.24. I have a couple of
questions.

1. Online documentation about class loader says,
System class loader operates on CLASSPATH. I have
included j2ee.jar in my CLASSPATH, but tomcat is not
picking it up. Why is it so?

2. When I use tomcat, system property
java.naming.factory.initial is initialized to
org.apache.naming.java.javaURLContextFactory. Where
did the system pick this property from? How can I 
override this setting? I initialized JNDI context with
environment having java.naming.factory.initial as
com.sun.enterprise.naming.SerialInitContextFactory
but ultimately 
org.apache.naming.java.javaURLContextFactory is set
to java.naming.factory.initial. How can I avoid
this?

I would appreciate if anybody can help me with these
issues. I am really struggling for a week.

tia,
Srinivas 

=
I am not afraid of losing. But I don't like it.

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



RE: System properties

2003-08-14 Thread Shapira, Yoav

Howdy,

But what do I have to do if I would like to set more than one system
property?

export JAVA_OPTS='-DpropName1=propValue1 -DpropName2=propValue2'  ???

Yes, as many as you want just like that.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



System properties

2003-08-14 Thread Christian Hauser
Hello

I'd like to know how I can set system properties when starting Tomcat 4.1.

I mean those properties that I can get from within a JSP file as:
System.getProperty(CONFIG_HOME)
Thank you in advance for any hint.

Christian



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


Re: System properties

2003-08-06 Thread Christian Hauser
Tim Funk wrote:

http://jakarta.apache.org/tomcat/faq/misc.html#properties

-Tim
Thank you Tim for pointing me to the right place.

But what do I have to do if I would like to set more than one system 
property?

export JAVA_OPTS='-DpropName1=propValue1 -DpropName2=propValue2'  ???

Regards,
  Christian


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


Re: System properties

2003-08-06 Thread Tim Funk
http://jakarta.apache.org/tomcat/faq/misc.html#properties

-Tim

Christian Hauser wrote:
Hello

I'd like to know how I can set system properties when starting Tomcat 4.1.

I mean those properties that I can get from within a JSP file as:
System.getProperty(CONFIG_HOME)
Thank you in advance for any hint.

Christian

 


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


Tomcat and system properties

2003-07-22 Thread Olivier Jouny
Hi all,

The system properties seems to be global in the tomcat JVM which means that
a webapps can get the property of an other. This is annoying when you use 
two
different version of the same web app where properties have different value.

Is it a normal behavior ?

Thanks.
Olivier.
_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.  
http://join.msn.com/?page=features/virus

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


RE: Tomcat and system properties

2003-07-22 Thread Bodycombe, Andrew
Yes. System properties are set for the JVM not each individual web
application.

http://java.sun.com/docs/books/tutorial/essential/system/properties.html

If you require properties specific to your web application, you should use
Servlet initialization parameters or ServletContext Initialization
parameters.

Andy

-Original Message-
From: Olivier Jouny [mailto:[EMAIL PROTECTED] 
Sent: 22 July 2003 10:28
To: [EMAIL PROTECTED]
Subject: Tomcat and system properties


Hi all,

The system properties seems to be global in the tomcat JVM which means that
a webapps can get the property of an other. This is annoying when you use 
two
different version of the same web app where properties have different value.

Is it a normal behavior ?

Thanks.
Olivier.

_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.  
http://join.msn.com/?page=features/virus


-
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: Tomcat and system properties

2003-07-22 Thread Tim Funk
Thats why its a System property. Its global to the JVM. If you want 
individual configuration options for your webapp then either:
- Place them in web.xml as init parameters
- Use JNDI and set the config items in server.xml (or appropriate)

-Tim

Olivier Jouny wrote:
Hi all,

The system properties seems to be global in the tomcat JVM which means that
a webapps can get the property of an other. This is annoying when you 
use two
different version of the same web app where properties have different 
value.

Is it a normal behavior ?

Thanks.
Olivier.
 


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


Set System properties at TC startup

2003-06-19 Thread christian . schuster




Hi list,

I have several web applications running. All of them have some properties
equal. They are also important in order to the web applications working
appropriatly. Is there a way at TC startup time to set these properties
(just Strings) and in case the properties are not found to let TC
immediately crash.

I am not really an expert in this and there may be a totally different way
how to do this.

Regards,

Christian Schuster

Rudolf Schuster AG
Postfach 277
CH - 3000 Bern 11

http://www.rsag.ch
++41 31 348 05 30


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



Re: Set System properties at TC startup

2003-06-19 Thread Bill Barker
Assuming that you are using TC 4.x (TC 3.3 has a different way of doing
this), then you create a file called setenv.(bat|sh) (of course, bat for
Windows, sh for *nix).  In this file you set the environment variable
CATALINA_OPTS to define the system properties that you need.

[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]




 Hi list,

 I have several web applications running. All of them have some properties
 equal. They are also important in order to the web applications working
 appropriatly. Is there a way at TC startup time to set these properties
 (just Strings) and in case the properties are not found to let TC
 immediately crash.

 I am not really an expert in this and there may be a totally different way
 how to do this.

 Regards,

 Christian Schuster

 Rudolf Schuster AG
 Postfach 277
 CH - 3000 Bern 11

 http://www.rsag.ch
 ++41 31 348 05 30




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



Re: Set System properties at TC startup

2003-06-19 Thread christian . schuster




Yes I am running Tomcat 4.1.18.

Where does this file need to be located that TC is reading it at startup?
Just somewhere along the classpath?

Christian Schuster

Rudolf Schuster AG
Postfach 277
CH - 3000 Bern 11

http://www.rsag.ch
++41 31 348 05 30


   
 Bill Barker 
 [EMAIL PROTECTED] 
 .com  To 
 Sent by: news [EMAIL PROTECTED]  
 [EMAIL PROTECTED]  cc 
 org  
   Subject 
   Re: Set System properties at TC 
 19.06.2003 09:45  startup 
   
   
 Please respond to 
   Tomcat Users   
   List   
 [EMAIL PROTECTED] 
  rta.apache.org  
   
   




Assuming that you are using TC 4.x (TC 3.3 has a different way of doing
this), then you create a file called setenv.(bat|sh) (of course, bat
for
Windows, sh for *nix).  In this file you set the environment variable
CATALINA_OPTS to define the system properties that you need.

[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]




 Hi list,

 I have several web applications running. All of them have some properties
 equal. They are also important in order to the web applications working
 appropriatly. Is there a way at TC startup time to set these properties
 (just Strings) and in case the properties are not found to let TC
 immediately crash.

 I am not really an expert in this and there may be a totally different
way
 how to do this.

 Regards,

 Christian Schuster

 Rudolf Schuster AG
 Postfach 277
 CH - 3000 Bern 11

 http://www.rsag.ch
 ++41 31 348 05 30




-
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: Set System properties at TC startup

2003-06-19 Thread Tim Funk
http://jakarta.apache.org/tomcat/faq/misc.html#properties

-Tim

[EMAIL PROTECTED] wrote:


Yes I am running Tomcat 4.1.18.

Where does this file need to be located that TC is reading it at startup?
Just somewhere along the classpath?
Christian Schuster

Rudolf Schuster AG
Postfach 277
CH - 3000 Bern 11
http://www.rsag.ch
++41 31 348 05 30
   
 Bill Barker 
 [EMAIL PROTECTED] 
 .com  To 
 Sent by: news [EMAIL PROTECTED]  
 [EMAIL PROTECTED]  cc 
 org  
   Subject 
   Re: Set System properties at TC 
 19.06.2003 09:45  startup 
   
   
 Please respond to 
   Tomcat Users   
   List   
 [EMAIL PROTECTED] 
  rta.apache.org  
   
   



Assuming that you are using TC 4.x (TC 3.3 has a different way of doing
this), then you create a file called setenv.(bat|sh) (of course, bat
for
Windows, sh for *nix).  In this file you set the environment variable
CATALINA_OPTS to define the system properties that you need.
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]


Hi list,

I have several web applications running. All of them have some properties
equal. They are also important in order to the web applications working
appropriatly. Is there a way at TC startup time to set these properties
(just Strings) and in case the properties are not found to let TC
immediately crash.
I am not really an expert in this and there may be a totally different
way

how to do this.

Regards,

Christian Schuster


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


Re: Set System properties at TC startup

2003-06-19 Thread John Turner
This looks pretty recent...is it?

John

On Thu, 19 Jun 2003 07:05:04 -0400, Tim Funk [EMAIL PROTECTED] wrote:

http://jakarta.apache.org/tomcat/faq/misc.html#properties

-Tim

[EMAIL PROTECTED] wrote:


Yes I am running Tomcat 4.1.18.

Where does this file need to be located that TC is reading it at 
startup?
Just somewhere along the classpath?

Christian Schuster

Rudolf Schuster AG
Postfach 277
CH - 3000 Bern 11
http://www.rsag.ch
++41 31 348 05 30


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


Re: Set System properties at TC startup

2003-06-19 Thread Tim Funk
Yup. I recently committed the FAQ to jakarta-tomcat-site. For the short term, 
I will probably try to make a mass update once a week or every other week 
based on questions, gaps, (and my own knowledge of the solution). I already 
have a list of updates I want to make. (I save a lot of potential responses 
to a faqqy folder in my email client and wade through it occasionally)

The new faq is now at http://jakarta.apache.org/tomcat/faq/

I hope to update the sourceforge version soon

-Tim

John Turner wrote:
This looks pretty recent...is it?

John

On Thu, 19 Jun 2003 07:05:04 -0400, Tim Funk [EMAIL PROTECTED] wrote:

http://jakarta.apache.org/tomcat/faq/misc.html#properties

-Tim

[EMAIL PROTECTED] wrote:



Yes I am running Tomcat 4.1.18.

Where does this file need to be located that TC is reading it at 
startup?
Just somewhere along the classpath?

Christian Schuster

Rudolf Schuster AG
Postfach 277
CH - 3000 Bern 11
http://www.rsag.ch
++41 31 348 05 30 


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


Re: Set System properties at TC startup [SOLVED]

2003-06-19 Thread christian . schuster




Thanks to all for the helpful hints.

Christian Schuster

Rudolf Schuster AG
Postfach 277
CH - 3000 Bern 11

http://www.rsag.ch
++41 31 348 05 30


   
 John Turner   
 [EMAIL PROTECTED] 
 turner.comTo 
   Tomcat Users List   
 19.06.2003 14:44  [EMAIL PROTECTED]
cc 
   
 Please respond to Subject 
   Tomcat Users   Re: Set System properties at TC 
   List   startup 
 [EMAIL PROTECTED] 
  rta.apache.org  
   
   
   
   





This looks pretty recent...is it?

John

On Thu, 19 Jun 2003 07:05:04 -0400, Tim Funk [EMAIL PROTECTED] wrote:

 http://jakarta.apache.org/tomcat/faq/misc.html#properties

 -Tim

 [EMAIL PROTECTED] wrote:



 Yes I am running Tomcat 4.1.18.

 Where does this file need to be located that TC is reading it at
 startup?
 Just somewhere along the classpath?

 Christian Schuster

 Rudolf Schuster AG
 Postfach 277
 CH - 3000 Bern 11

 http://www.rsag.ch
 ++41 31 348 05 30


-
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: Set System properties at TC startup

2003-06-19 Thread John Turner
Cool!

John

On Thu, 19 Jun 2003 09:23:47 -0400, Tim Funk [EMAIL PROTECTED] wrote:

Yup. I recently committed the FAQ to jakarta-tomcat-site. For the short 
term, I will probably try to make a mass update once a week or every 
other week based on questions, gaps, (and my own knowledge of the 
solution). I already have a list of updates I want to make. (I save a lot 
of potential responses to a faqqy folder in my email client and wade 
through it occasionally)

The new faq is now at http://jakarta.apache.org/tomcat/faq/

I hope to update the sourceforge version soon

-Tim

John Turner wrote:
This looks pretty recent...is it?

John

On Thu, 19 Jun 2003 07:05:04 -0400, Tim Funk [EMAIL PROTECTED] wrote:

http://jakarta.apache.org/tomcat/faq/misc.html#properties

-Tim

[EMAIL PROTECTED] wrote:



Yes I am running Tomcat 4.1.18.

Where does this file need to be located that TC is reading it at 
startup?
Just somewhere along the classpath?

Christian Schuster

Rudolf Schuster AG
Postfach 277
CH - 3000 Bern 11
http://www.rsag.ch
++41 31 348 05 30


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



--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Configuring System properties

2003-02-07 Thread Sreedhar, Dantam
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]




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]




tomcat system properties

2002-09-17 Thread Ralph Goers

Where are the system properties used by tomcat documented somewhere?  Are there any 
others besides catalina.home and catalina.base?

Thanks,
Ralph



RE: tomcat system properties

2002-09-17 Thread Turner, John


CATALINA_HOME/bin/catalina.bat or catalina.sh has the full list.

John


 -Original Message-
 From: Ralph Goers [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, September 17, 2002 2:23 PM
 To: Tomcat Users List
 Subject: tomcat system properties
 
 
 Where are the system properties used by tomcat documented 
 somewhere?  Are there any others besides catalina.home and 
 catalina.base?
 
 Thanks,
 Ralph
 

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




System properties

2002-05-03 Thread Richard Wooding

Hi all,

Is it possible to change system properties from within' a JSP page.

Regards
Richard Wooding


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: System properties

2002-05-03 Thread PChaganti

What system properties are you referring to? 

prabhakar





Is it possible to change system properties from within' a JSP page.



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




how to set environment variable(or system properties)

2002-04-29 Thread Leland Chen

Hi all,

  I try to move an application from Netscape fasttrack web server
  to tomcat 4.0.1. I found there are some environment variables
  defined in netscape config jvm12.conf file. The environment
  variables are used in some of the servlets.

  Any one knows where to define these enviornment variables
  in tomcat ? I especially like the environment variables(or
  system properties) can be defined to one particular application.

  Thanks,

  Leland

_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: System properties

2000-11-27 Thread Miles Daffin

Craig,

I was wondering if there is an optimal way of doing the following in TomCat?
If you have the time to briefly describe such

Thanks

Miles

  (I prefer to store global application
  objects in
   the servlet context, so that they are easily visible to all servlets
and
  JSP
   pages in my apps).

p.s. please would you cc any response to my address.






Re: System properties

2000-11-27 Thread Craig R. McClanahan

Miles Daffin wrote:

 Craig,

 I was wondering if there is an optimal way of doing the following in TomCat?
 If you have the time to briefly describe such

 Thanks

 Miles

   (I prefer to store global application
   objects in
the servlet context, so that they are easily visible to all servlets
 and
   JSP
pages in my apps).

 p.s. please would you cc any response to my address.

Yes, it's easy in Tomcat (or any other servlet container that implements servlet
2.2 or later).

What I normally do is define a servlet to initialize my application resources,
and declare it load-on-startup in the web.xml file (so that the time-consuming
stuff happens when the server starts instead of on the first request).  As part
of the init() method of this servlet, I store these resources as a servlet
context attribute.

For example, lets say you have a nice fancy connection pool object that you want
to make available to the servlets and JSP pages of your application.  In the
init() method of the startup servlet, you just need to do the following:

ConnectionPool myPool = ... create the pool object ...
getServletContext().setAttribute("pool", myPool);

Now, any servlet in your application can acquire a reference to this pool in the
doGet() or doPost() method:

ConnectionPool thePool =
  (ConnectionPool) getServletContext().getAttribute("pool");

Or, in a JSP page, you can access it like this:

jsp:useBean id="pool" type="com.mycompany.ConnectionPool"
 scope="application"/

Craig McClanahan





Re: System properties

2000-11-20 Thread Miles Daffin

Hi guys,

  From the looks of things, it is just the way it is, although I was
hoping
  the there would be some way to put stuff in the web.xml file, maybe in
the
  servlet tag like:
 
  system-property
  namemyproperty/name
  value42/value
  /system-property
 
  Anyone think this is a good idea, or am I talking rubbish?

 It's a bad idea.  Keep your web-apps encapsulated.

Why would such a move, if it were possible, break encapsulation?

As long as this property value is never broadcast
i.e. System.setProperty("myProperty", "42");

If you want application local properties then simply create a class to hold
them
with a static method for obtaining them from anywhere in your app (like
System.getProperties()).

Have a Servlet initialize these by passing it the location of a properties
file containing the
props you need as an initialization parameter. This Servlet can be loaded on
startup,
load in the properties, and there you are, unless I have completely
misunderstood.

Check out the API for java.util.Properties#load(InputStream in)


 There is two ways to think about a "global" service:
 - providing a service to many servlets, seems like a good thing
 or
 - bleeding out dependencies upon those that don't need them and allowing
 access to those that shouldn't be using it.  bad things


What is 'bleeding out dependencies'? Please explain.

  PS. static, bad?  It is useful! ...

 she said and meant _static initializers_ = bad, not static methods, and
 members.  I concur.

Why are static init blocks || methods bad?
Under what circumstances? In a Servlet context?

Please explain.

Miles




Re: System properties

2000-11-20 Thread Craig R. McClanahan

Miles Daffin wrote:

  
   As long as this property value is never broadcast
   i.e. System.setProperty("myProperty", "42");
  
 
  System properties, in the sense that we are talking about the
 java.lang.System
  class, are global to the entire JVM.  Therefore, even if the statement
 above was
  allowed, it would set the property "myProperty" for *all* web applications
 that
  are installed in a single Tomcat instance, and would therefore cause a
 name
  clash if another app also tried to set the value for "myProperty".

 Are such System calls prevented (intercepted somehow) in TC?


If you are running under JDK 1.1, they are prevented by the fact that JDK 1.1
does not have this method.

If you are running Tomcat 3.2 under a security manager, you can configure your
security policies to prevent this if you want to -- otherwise there is no
restriction.


  Context parameters, on the other hand, are unique to an individual web
  application so there are no problems with two web-apps having parameters
 (or
  anything else, for that matter) with the same names.

 I shall use them from now on.

 snip-paragraph:  my suggestion

  You can use static variables for this purpose and get away with it, as
 long as
  the classes involved are loaded from WEB-INF/classes or WEB-INF/lib.  The
 reason
  for this is that each web application is loaded by its own class loader,
 so
  statics created by such classes are visible only within the web app. I
 have a
  personal bias against statics (I prefer to store global application
 objects in
  the servlet context, so that they are easily visible to all servlets and
 JSP
  pages in my apps).

 Do you mean that you have a class, say Contants, that has a bunch of statics
 (public contants and maybe methods) that is only visible to objects in a
 particular
 app? In which case you are still using statics - only the scope has been
 narrowed,
 for obviously good reasons.


Let's say I have class com.mycompany.mypackage.MyClass that has a static method
foo().  Let's say that I install this class under WEB-INF/classes in two
different web apps.

In this scenario, there are two instances of MyClass in memory (even though they
have the same name), because they are loaded by two different class loaders.

The only way to have a static global across web apps in Tomcat is to put it on
the system classpath -- but beware:  the ability to do this portably is *not*
guaranteed by the servlet spec.


 
   Miles
 
  Craig
 
 Miles

Craig





Re: System properties

2000-11-19 Thread Jim Rudnicki


 From the looks of things, it is just the way it is, although I was hoping
 the there would be some way to put stuff in the web.xml file, maybe in the
 servlet tag like:

 system-property
 namemyproperty/name
 value42/value
 /system-property

 Anyone think this is a good idea, or am I talking rubbish?

It's a bad idea.  Keep your web-apps encapsulated.

There is two ways to think about a "global" service:
- providing a service to many servlets, seems like a good thing
or
- bleeding out dependencies upon those that don't need them and allowing
access to those that shouldn't be using it.  bad things

 PS. static, bad?  It is useful! ...

she said and meant _static initializers_ = bad, not static methods, and
members.  I concur.

Jim




Re: System properties

2000-11-17 Thread Rachel Greenham

On Friday 17 November 2000 14:27, you wrote:
 Hi,

 I was wondering if it is possible to pass properties to Tomcat.  I have
 some classes which read various system properties in their static
 initializers, and this works fine when using these classes on the command
 line using "java -Dproperty=value".  However I am not sure how to pass
 these properties into tomcat when I start it.  Is there something in one of
 the XML files?

yes, you can do it, by supplying it in TOMCAT_OPTS when invoking Tomcat.

However, it's ugly and results in non-portable web applications (you need to 
set the properties on whatever servlet container is being used, and restart 
it, and some may not allow you to set such things). It would be *better* to 
put the properties you want into some config file specific to your web 
application, in WEB-INF, to be loaded through ServletContext.getResource(), 
or as servlet init parameters. Static initialisers? Ugh. Specify instead that 
your servlets are to be initialised and get the data then. Self-containment 
is the watchword for web applications.

-- 
Rachel



RE: System properties

2000-11-17 Thread Stuart Farnan

Rachel,

Thanks for that, about the static initializers... The classes that use them
are not servlets, merely utility classes are used in the web application and
also elsewhere.

For instance, a class, or series of classes that deal with database
connection pooling, could conceiveably have a configuration file to let them
know what pools to set up, min and max connections, where the server is,
what the driver class is, etc.  And these classes are useful in other apps,
not only in web applications.  Now of course you can hard code into the
class, the file to load, but this is ugly, it is nicer to say "java
-Ddb.properties=/home/stuart/db.properties".  As the classes are not
servlets, servletContext.getResource() is not really an option.

I could not find anything about TOMCAT_OPTS on the web site, persumably this
is an environment variable, what format do you put system properties in, is
it like
TOMCAT_OPTS="db.properties=/home/stuart/db.properties:myproperty=anotherprop
ertyvalue:.."?

Thanks for your help,

Stuart

-Original Message-
From: Rachel Greenham [mailto:[EMAIL PROTECTED]]
Sent: 17 November 2000 15:21
To: [EMAIL PROTECTED]
Subject: Re: System properties


On Friday 17 November 2000 14:27, you wrote:
 Hi,

 I was wondering if it is possible to pass properties to Tomcat.  I have
 some classes which read various system properties in their static
 initializers, and this works fine when using these classes on the command
 line using "java -Dproperty=value".  However I am not sure how to pass
 these properties into tomcat when I start it.  Is there something in one
of
 the XML files?

yes, you can do it, by supplying it in TOMCAT_OPTS when invoking Tomcat.

However, it's ugly and results in non-portable web applications (you need to

set the properties on whatever servlet container is being used, and restart 
it, and some may not allow you to set such things). It would be *better* to 
put the properties you want into some config file specific to your web 
application, in WEB-INF, to be loaded through ServletContext.getResource(), 
or as servlet init parameters. Static initialisers? Ugh. Specify instead
that 
your servlets are to be initialised and get the data then. Self-containment 
is the watchword for web applications.

-- 
Rachel



RE: System properties

2000-11-17 Thread Stuart Farnan

OK marvellous,

I get all that, TOMCAT_OPTS is not my first choice if it is just basically
the command line.  On the subject of using a startup servlet to do the work
of reading the info and passing it on to the utility classes that need it,
this is an option, but would mean writing a servlet for to do this, and
also, anywhere else I use the utility classes, they would need to be
'initialised' in the same way by some other class in the other application.
This would of course have to happen before the class is used, and I had
thought that is should be possible to encapsulate all the details of the
connection pooling in one place, including the actions of reading the system
properties file.  Yeah, all the stuff is in process, no separate database
access server.

From the looks of things, it is just the way it is, although I was hoping
the there would be some way to put stuff in the web.xml file, maybe in the
servlet tag like:

system-property
namemyproperty/name
value42/value
/system-property

Anyone think this is a good idea, or am I talking rubbish?

Stu

PS. static, bad?  It is useful! Singletons (you mentioned), cleanly handling
exceptions in constructors, general things you want to share between
instances, object caches, etc.

-Original Message-
From: Rachel Greenham [mailto:[EMAIL PROTECTED]]
Sent: 17 November 2000 16:18
To: [EMAIL PROTECTED]
Subject: Re: System properties


On Friday 17 November 2000 15:46, you wrote:
 Rachel,

 Thanks for that, about the static initializers... The classes that use
them
 are not servlets, merely utility classes are used in the web application
 and also elsewhere.

 For instance, a class, or series of classes that deal with database
 connection pooling, could conceiveably have a configuration file to let
 them know what pools to set up, min and max connections, where the server
 is, what the driver class is, etc.  And these classes are useful in other
 apps, not only in web applications.  Now of course you can hard code into
 the class, the file to load, but this is ugly, it is nicer to say "java
 -Ddb.properties=/home/stuart/db.properties".  As the classes are not
 servlets, servletContext.getResource() is not really an option.

Yes it is. Your startup servlet reads these parameters, parses that data,
and 
then invokes your utility classes with that initialisation data.

consider "static" harmful. :-) I only ever use it to define constants, like 
database field names or whatnot, or to hold the instance of a
single-instance 
class.

Basically, if your database accesses are going on in the same *process* as 
your servlets, ie: you have some generic headless data-access javabeans that

do the work and you want to call them from your servlets, you should still 
have a servlet that's initialised on startup of the web application, and 
*that* initialises your data-access beans. That way you can also catch the 
web application being shut down and cleanly close down your data-access 
classes too.

If your data-access is happening in another process from your servlets, and 
communicating over network sockets, eg: using RMI or XML/SOAP type thing, 
then you initialise that task in any way you see fit - the servlet engine 
just talks to it when it wants to. If you're doing this, you may well want
to 
look seriously at EJB.

 I could not find anything about TOMCAT_OPTS on the web site, persumably
 this is an environment variable, what format do you put system properties
 in, is it like

TOMCAT_OPTS="db.properties=/home/stuart/db.properties:myproperty=anotherpro
p ertyvalue:.."?

Not quite. TOMCAT_OPTS is just given to the java command line used to invoke

Tomcat, so it's in that format, ie: "-Ddb.properties=value" etc.

-- 
Rachel



RE: System properties

2000-11-17 Thread Stuart Farnan

John

Thanks for that, will look into further and let you know.

Stuart

-Original Message-
From: John Ellis [mailto:[EMAIL PROTECTED]]
Sent: 17 November 2000 17:44
To: [EMAIL PROTECTED]
Subject: Re: System properties


According to the dtd:
http://java.sun.com/j2ee/dtds/web-app_2.2.dtd
There is an "env-entry" tag that has name-value pairs like you mentioned.
The
version of tomcat that I am using (3.1) did not seem to being doing anything
with this entry.  It does seem like it would be the perfect place for
exactly
what you are talking about.

Does anyone know what this entry is (the dtd description did not
specifically
say how to get these values back -- I am assuming System.getProperties())?
Does
anyone know if more current version of tomcat support it?  Will future
versions?

John

Stuart Farnan wrote:

 OK marvellous,

 I get all that, TOMCAT_OPTS is not my first choice if it is just basically
 the command line.  On the subject of using a startup servlet to do the
work
 of reading the info and passing it on to the utility classes that need it,
 this is an option, but would mean writing a servlet for to do this, and
 also, anywhere else I use the utility classes, they would need to be
 'initialised' in the same way by some other class in the other
application.
 This would of course have to happen before the class is used, and I had
 thought that is should be possible to encapsulate all the details of the
 connection pooling in one place, including the actions of reading the
system
 properties file.  Yeah, all the stuff is in process, no separate database
 access server.

 From the looks of things, it is just the way it is, although I was hoping
 the there would be some way to put stuff in the web.xml file, maybe in the
 servlet tag like:

 system-property
 namemyproperty/name
 value42/value
 /system-property

 Anyone think this is a good idea, or am I talking rubbish?

 Stu

 PS. static, bad?  It is useful! Singletons (you mentioned), cleanly
handling
 exceptions in constructors, general things you want to share between
 instances, object caches, etc.

 -Original Message-
 From: Rachel Greenham [mailto:[EMAIL PROTECTED]]
 Sent: 17 November 2000 16:18
 To: [EMAIL PROTECTED]
 Subject: Re: System properties

 On Friday 17 November 2000 15:46, you wrote:
  Rachel,
 
  Thanks for that, about the static initializers... The classes that use
 them
  are not servlets, merely utility classes are used in the web application
  and also elsewhere.
 
  For instance, a class, or series of classes that deal with database
  connection pooling, could conceiveably have a configuration file to let
  them know what pools to set up, min and max connections, where the
server
  is, what the driver class is, etc.  And these classes are useful in
other
  apps, not only in web applications.  Now of course you can hard code
into
  the class, the file to load, but this is ugly, it is nicer to say "java
  -Ddb.properties=/home/stuart/db.properties".  As the classes are not
  servlets, servletContext.getResource() is not really an option.

 Yes it is. Your startup servlet reads these parameters, parses that data,
 and
 then invokes your utility classes with that initialisation data.

 consider "static" harmful. :-) I only ever use it to define constants,
like
 database field names or whatnot, or to hold the instance of a
 single-instance
 class.

 Basically, if your database accesses are going on in the same *process* as
 your servlets, ie: you have some generic headless data-access javabeans
that

 do the work and you want to call them from your servlets, you should still
 have a servlet that's initialised on startup of the web application, and
 *that* initialises your data-access beans. That way you can also catch the
 web application being shut down and cleanly close down your data-access
 classes too.

 If your data-access is happening in another process from your servlets,
and
 communicating over network sockets, eg: using RMI or XML/SOAP type thing,
 then you initialise that task in any way you see fit - the servlet engine
 just talks to it when it wants to. If you're doing this, you may well want
 to
 look seriously at EJB.

  I could not find anything about TOMCAT_OPTS on the web site, persumably
  this is an environment variable, what format do you put system
properties
  in, is it like
 

TOMCAT_OPTS="db.properties=/home/stuart/db.properties:myproperty=anotherpro
 p ertyvalue:.."?

 Not quite. TOMCAT_OPTS is just given to the java command line used to
invoke

 Tomcat, so it's in that format, ie: "-Ddb.properties=value" etc.

 --
 Rachel



Re: System properties

2000-11-17 Thread Craig R. McClanahan

John Ellis wrote:

 According to the dtd:
 http://java.sun.com/j2ee/dtds/web-app_2.2.dtd
 There is an "env-entry" tag that has name-value pairs like you mentioned.  The
 version of tomcat that I am using (3.1) did not seem to being doing anything
 with this entry.  It does seem like it would be the perfect place for exactly
 what you are talking about.


The env-entry, resource-ref, and ejb-ref values in the deployment descriptor
are for use when you are running a servlet container inside a J2EE server.  Tomcat
doesn't support them when running standalone.

A good way to introduce application-wide initialization parameters, though, is to
use the context-param element.  Values you enter here can be retrieved from any
servlet or JSP page in the web app like this:

String value = getServletContext().getInitParameter("name");



 Does anyone know what this entry is (the dtd description did not specifically
 say how to get these values back -- I am assuming System.getProperties())?  Does
 anyone know if more current version of tomcat support it?  Will future versions?


You would not really want to use system properties for this in the first place.
What would you do if you're running two different web apps in the same servlet
container, and they both needed a property named "abc"?


 John


Craig McClanahan