tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Barker" <wbar...@wilshire.com>
Subject Re: Running Tomcat Embedded
Date Wed, 12 Jul 2006 02:55:56 GMT

"Mike Wannamaker" <Mike.Wannamaker@KINGSTON.Hummingbird.com> wrote in 
message 
news:D329907434F70B4F9ECF5D37CEFE93C101EDA65C@kingstonx2.andynehcl.com...
> Thanks Bill,
>
> I've looked at that and we actually have it running that way.  What I'm
> looking for is a way to duplicate org.apache.catalina.startup.Bootstrap
> class in my own startup.  I believe that JBoss does something similar? 
> What
> I really want to do is get my version of Tomcat that I startup to work 
> like
> starting Tomcat manually.  I want it to read the server.xml and 
> context.xml
> files for web apps.
>

Actually, I believe that JBoss uses JMX-embedding (I know that the 
JMX-embedding was largely developed to help JBoss, but I've never cared 
enough to actually look through the JBoss code :).

> Is this possible?

If you want it to start exactly like it would normally, then of course you 
could always just create in instance of Bootstrap, and call init and start 
on it (this is what jsvc does).

Otherwise, you probably want to extend Catalina instead of Embedded and 
override load() so that you can specify alternate locations for server.xml 
and add Digester rules to do customizations that are more then just setting 
attributes.  Setting the lib directories is just a matter of defining the CL 
that you load Catalina from, and passing it the "shared" CL to 
setParentClassLoader.  Changing the location of where Tomcat looks for the 
context.xml files is more work, since you'd have to extend HostConfig, and 
then remove the one that Tomcat added, and add yours instead.
>
> Mike Wannamaker
> Senior Software Developer
> Hummingbird Ltd.
> 552 Princess St, Kingston, ON, K7L 1C7
> Tel: (613) 548-4355 x4535
> Fax (613) 548-7801
> E-Mail: Mike Wannamaker
>
> www.hummingbird.com
>
> IMPORTANT NOTICE: This communication is privileged and contains 
> confidential
> information for the sole use of the intended recipient(s). Any 
> unauthorized
> disclosure, copying or use of this communication is strictly prohibited. 
> If
> you have received this message in error, please contact the sender and
> delete this message without printing it or otherwise retaining a copy.
> -----Original Message-----
> From: Bill Barker [mailto:wbarker@wilshire.com]
> Sent: July 10, 2006 11:44 PM
> To: users@tomcat.apache.org
> Subject: Re: Running Tomcat Embedded
>
>
> "Mike Wannamaker" <Mike.Wannamaker@KINGSTON.Hummingbird.com> wrote in
> message
> news:D329907434F70B4F9ECF5D37CEFE93C101EDA652@kingstonx2.andynehcl.com...
>>I wish to run Tomcat from within my own JVM.  I would like it to run just
>> like Tomcat does today, however I'd just like to setup the various paths,
>> for like web app root directory, config directory, lib directory etc....
>>
>> Is there anyway to do this easily?  Like I said I just want to create an
>> instance of Tomcat/Catalina and setProperties(...); and then call 
>> start();
>>
>> Any help is appreciated.
>>
>
> Most people use Embedded
> (http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/catali
> na/startup/Embedded.html)
> since it at least has some documentation.  Commons-modeler has a simple 
> (if
> slightly out of date :) example of how to embed Tomcat using JMX.  This is
> useful if you want Tomcat to run in a different ClassLoader than the rest 
> of
>
> your application (and at least personally, I find it easier to use).
>
> In either case, you need to set the properties on the sub-components (e.g.
> Engine, Host, Contex(s)) yourself, so you are responsible for creating 
> them.
>
>>
>> Mike Wannamaker
>> Senior Software Developer
>> Hummingbird Ltd.
>> 552 Princess St, Kingston, ON, K7L 1C7
>> Tel: (613) 548-4355 x4535
>> Fax (613) 548-7801
>> E-Mail: Mike Wannamaker
>>
>> www.hummingbird.com
>>
>> IMPORTANT NOTICE: This communication is privileged and contains
>> confidential
>> information for the sole use of the intended recipient(s). Any
>> unauthorized
>> disclosure, copying or use of this communication is strictly prohibited.
>> If
>> you have received this message in error, please contact the sender and
>> delete this message without printing it or otherwise retaining a copy.
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>>
>>
>
>
>
>
> ---------------------------------------------------------------------
> 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
>
>
>
> ---------------------------------------------------------------------
> 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
>
> 




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


Mime
View raw message