tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johannes Ernst <>
Subject Re: Custom WebappLoader, Jasper and custom JSP tags
Date Fri, 16 Mar 2012 15:57:58 GMT
On Mar 16, 2012, at 5:07, Pid wrote:

> On 15/03/2012 23:44, Johannes Ernst wrote:
>> I've implemented my own org.apache.catalina.loader.WebappLoader. It consults a bunch
of JARs held in the file system outside of the WAR.
> Would one of the shared/common classloaders in Tomcat not achieve the
> same thing - what is unique about the problem that requires a custom
> classloader?

Good question, I guess I should have started with explaining it.

I'm attempting to integrate with InfoGrid's module framework (

InfoGrid is an open-source graph database ( ) and web framework. Its
module framework breaks the InfoGrid code base into > 100 modules with declared and managed
dependencies. Developers using InfoGrid can pick and choose those modules that they actually
need in their apps. Some also look up modules at run-time and dynamically add those modules
at run-time to a running app.

You can think of each module as a JAR, with associated metadata and a custom ClassLoader.
A bit like OSGI but class-based rather than services-based.

Traditionally, InfoGrid apps running in Tomcat have bundled all the modules/JARs of the app
into the WAR. We'd like to go beyond that so:
 * multiple InfoGrid apps on the same Tomcat instance point to the same module/JAR version,
thereby being guaranteed to be running the same version
 * (controlled) data sharing can occur between multiple InfoGrid apps on the same Tomcat instance,
which is useful because of InfoGrid's in-memory caching
 * dynamic module lookup is available to InfoGrid apps running in Tomcat as well (which requires
dynamic addition of code and thus messing with ClassLoaders)

The basic design is to have a custom ClassLoader initiated through a custom Tomcat WebAppLoader,
which has the usual parent (so, for example, JSPs and the generated code can be found) but
also delegates to the ClassLoaders for the InfoGrid modules that the app depends on.

This seems to work fine so far except that I'm stuck on support for custom tags, of which
we have a bunch in InfoGrid to make JSP development easy on a graph foundation. I have managed
to get the TLDs found, to have the JSP->Java codegen working, but the Java->class seems
to be getting the wrong class path.

And I'm a little lost where in Tomcat that info is being put together.

Does this make sense?



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message