tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: SharingWebappClassLoader proposal
Date Tue, 03 Aug 2010 15:09:14 GMT
2010/8/3 Lohner Roland <loczaj@gmail.com>:
> Dear Developers,
>
> I am writing about a proposal for a new feature in Tomcat.
>

(...)

> so the only solution at the
> moment is to use a J2EE container and deploy an enterprise module which
> causes unnecessary overheat.

I think the following should work:

1. Separate the interfaces, and _all the classes they need_,
into a separate JAR.
2. Put the JAR into ${catalina.base}/lib.
3. _Remove_ all those shared classes from web applications!
(Because otherwise classes loaded from web applications have priority
over the shared ones, as explained in
http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html
)

4. If you need some shared service, place it into JNDI
(GlobalNamingResources element in server.xml).
You can also add a Listener to server.xml to preload some classes or
instantiate any static object.

5. Restart Tomcat.

>
> A less elaborate, hackish, but basically working implementation of this
> special web application class loader is attached to this email.

The attachment was removed by mailing list software.
Maybe if you rename it to *.txt it will be allowed, but it is just a guess.
Anyway, if it works how you describe it it seeks for trouble.  A web
application and be unloaded (stopped, reloaded) at any time. Since
that moment any classes loaded by its classloader should not be
accesses any more. Thus, no other web applications should keep
references to them.


Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message