You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Tom Price <To...@metaswitch.com> on 2008/03/28 17:26:26 UTC

Setting catalina.properties options with embedded Tomcat

Hi,

I run Tomcat 5.5.16 embedded within a Java application, and currently do
not have a file called catalina.properties in the installation.  I would
like to change an option which is normally in that file, so my question
is how do I do that?

I've tried creating a "conf" directory under my main "tomcat" directory
(which is set as the Catalina base and home directories when I launch
the embedded Tomcat) and creating a catalina.properties file in there,
but I don't see any evidence that it's being picked up (e.g. I've set
some invalid options in there and there are no complaints).  What would
be a good way to check whether this file is being picked up?

Alternatively, is there a way to programmatically set the
catalina.properties options in Java when I launch Tomcat?

Thanks,
Tom.

---------------------------------------------------------------------
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: Setting catalina.properties options with embedded Tomcat

Posted by Tom Price <To...@metaswitch.com>.
Rainer Jung wrote:
> Then it's easy, the StringCache class gets it as a system property. So

> you simply set it as a system property from your own code, before 
> embedded Tomcat gets it. Values are "false" or "true".

Great, thanks.

---------------------------------------------------------------------
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: Setting catalina.properties options with embedded Tomcat

Posted by Rainer Jung <ra...@kippdata.de>.
Tom Price schrieb:
> Rainer,
> 
> Rainer Jung wrote:
>> What do you try to set via catalina.properties?
> 
> Thanks for the information.  I'm trying to set:
> 
> tomcat.util.buf.StringCache.byte.enabled=false

Then it's easy, the StringCache class gets it as a system property. So 
you simply set it as a system property from your own code, before 
embedded Tomcat gets it. Values are "false" or "true".

HTH

Rainer

---------------------------------------------------------------------
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: Setting catalina.properties options with embedded Tomcat

Posted by Tom Price <To...@metaswitch.com>.
Rainer,

Rainer Jung wrote:
> What do you try to set via catalina.properties?

Thanks for the information.  I'm trying to set:

tomcat.util.buf.StringCache.byte.enabled=false

Thanks,
Tom.

---------------------------------------------------------------------
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: Setting catalina.properties options with embedded Tomcat

Posted by Rainer Jung <ra...@kippdata.de>.
Hi,

Tom Price schrieb:
> Hi,
> 
> I run Tomcat 5.5.16 embedded within a Java application, and currently do
> not have a file called catalina.properties in the installation.  I would
> like to change an option which is normally in that file, so my question
> is how do I do that?
> 
> I've tried creating a "conf" directory under my main "tomcat" directory
> (which is set as the Catalina base and home directories when I launch
> the embedded Tomcat) and creating a catalina.properties file in there,
> but I don't see any evidence that it's being picked up (e.g. I've set
> some invalid options in there and there are no complaints).  What would
> be a good way to check whether this file is being picked up?
> 
> Alternatively, is there a way to programmatically set the
> catalina.properties options in Java when I launch Tomcat?

don't know much about embedded Tomcat, but the catalina.properties 
parsing code called by the Bootstrap.class looks for it first in the 
conf sub directory of CATALINA_BASE (you can set CATALINA_BASE 
programmatically via the system property catalina.base), and if it can't 
find it there, it tries to load 
"/org/apache/catalina/startup/catalina.properties", so you could also 
place the file somewhere in your jars.

Caution: by default there is already a 
"/org/apache/catalina/startup/catalina.properties" in the Tomcat 
bootstrap.jar.

If you are using the Embedded.class, I think it doesn't load 
catalina.properties.

What do you try to set via catalina.properties?

> Thanks,
> Tom.

Regards,

Rainer

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