tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Re: Tomcat + jBoss class loader integration
Date Wed, 04 Oct 2000 02:32:19 GMT
Sebastien,

I'm glad that you got this to work.  However, there is only one minor problem with your patch
-- it is not
compatible with JDK 1.1, and we're trying to maintain 1.1 compatibility for Tomcat 3.2 (with
4.0 it won't matter
because Java2 is required, and the context class loader is already set :-).

To get around this, the Java2 specific functionality has been encapsulated in a RequestInterceptor
(org.apache.tomcat.request.Jdk12Interceptor).  If you ensure that this interceptor is installed,
the context class
loader will be set correctly and your patch should be unnecessary.

Craig McClanahan


Sebastien Alborini wrote:

> Hi,
>
> Following Aaron Mulder's post on the subject, I've finally managed
>
> - to make tomcat and jboss live in the same VM (using the
> org.apache.tomcat.startup.EmbededTomcat launcher)
>
> - to make a jboss container and a tomcat context share the same
> classloader.  This means that they can exchange objects without relying
> on RMI, and without the odd behavior Aaron described (same class +
> different classloader = different class).  With this, they can
> communicate *MUCH* faster.
>
> The idea was to use the context classloader as a parent in both tomcat
> and jboss.  The deployer tool can then feed this context classloader
> before calling jboss.deploy and EmbededTomcat.addContext.  It requires a
> one-line change in tomcat's code (see patch) : setting the
> AdaptiveServletLoader's parent to the contextClassLoader instead of
> this.getClass().getClassLoader().
>
> This change does not seem to affect tomcat otherwise, since the default
> ContextClassLoader always contains tomcat's classes.
>
> This has been tested with tomcat 3.2b4 / 3.2b5
>
> Thanks,
>
> Sebastien
>
>   ------------------------------------------------------------------------
> --- jakarta-tomcat/src/share/org/apache/tomcat/context/LoaderInterceptor.java.orig  
   Tue Oct  3 18:13:53 2000
> +++ jakarta-tomcat/src/share/org/apache/tomcat/context/LoaderInterceptor.java   Tue Oct
 3 18:14:19 2000
> @@ -91,7 +91,7 @@
>      {
>          ContextManager cm = context.getContextManager();
>         AdaptiveServletLoader loader=new AdaptiveServletLoader();
> -       loader.setParentLoader(this.getClass().getClassLoader());
> +       loader.setParentLoader(Thread.currentThread().getContextClassLoader());
>         context.setServletLoader( loader );
>
>          String base = context.getDocBase();
>
>   ------------------------------------------------------------------------
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org

--
====================
See you at ApacheCon Europe <http://www.apachecon.com>!
Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
                                    Applications to Tomcat



Mime
View raw message