You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by be...@maximus.Central.Sun.COM on 2002/07/22 04:35:19 UTC

Embedding Tomcat 4

I would like to embed Tomcat 4 in an existing application. 
Furthermore, I need to be able to specify a parent classloader
for the "common" classloader other than the system classloader.
I know how to achieve the first goal, but not the second (I
believe the EmbededTomcat class could be used to specify the
parent classloader for "common" in Tomcat 3).

Any help would be most appreciated.

Thanks.

--- Brandon E Taylor

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Embedding Tomcat 4

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Sun, 21 Jul 2002 betaylor@maximus.Central.Sun.COM wrote:

> Date: Sun, 21 Jul 2002 22:35:19 -0400 (EDT)
> From: betaylor@maximus.Central.Sun.COM
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> Subject: Embedding Tomcat 4
>
> I would like to embed Tomcat 4 in an existing application.
> Furthermore, I need to be able to specify a parent classloader
> for the "common" classloader other than the system classloader.
> I know how to achieve the first goal, but not the second (I
> believe the EmbededTomcat class could be used to specify the
> parent classloader for "common" in Tomcat 3).
>

The standard Catalina class loaders are only set up if you use the
org.apache.catalina.startup.Bootstrap startup class (as the usual shell
scripts do).  If you use some other mechanism (such as the
o.a.c.s.Embedded class), you can set up class loaders however you like --
but you have to set up your own.

Normally, the parent class loader of a webapp will be the shared class
loader.  However, you can set the parent class loader for a Context (or
for a Host or Engine) itself, by calling setParentClassLoader() before you
call start() on that object.  This should be sufficient to meet your
needs.  (The J2EE Reference Implementation, for example, uses this
technique in its own embedding of Tomcat.)

> Any help would be most appreciated.
>
> Thanks.
>
> --- Brandon E Taylor
>

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>