cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pier P. Fumagalli" <>
Subject WEB-INF classloading and on the fly compilation
Date Thu, 14 Sep 2000 11:42:48 GMT
<?xml version="1.0"?>

<rant spam="everyone">

<target audience="cocoon-people">
  It seems that all our classloading related problems are now fixed...
  BUT (yes, there's always a creepy BUT)...

This is a wider problem, that's why I'm spamming basically all mailing
list on the subject...

We have to compile ON-THE-FLY (at runtime) a file generated and/or
included in the WEB-APP, stupid, indeed. If we see it from Cocoon, we
can see that the Sitemap needs to be compiled before execution, if we
see it from the JSP side of things, we want to compile a JSP into a

Just imagine that this thing we have to compile DEPENDS on another JAR
included in our little web-app (maybe a set of utility classes, maybe
whatever, I have the classes somewhere in the WEB-APP).

I am _SURE_ that the JAVAC classes and the WEB-APP are loaded by the
same classloader (I moved tools.jar from my jkd/lib to
WEB-APP/WEB-INF/lib and checked with System.identityHashCode()), just in
case, but I also ran the same test having the tools.jar loaded by the
system classloader and the WEB-APP loaded by it's own classloader...

What happens when I compile? All the references I put to all the objects
in my WEB-APP bundled jar (those utility classes I want to distribute
with my WEB-APP) are not resolved. JavaC doesn't find a pre-compiled
class existent in my WEB-APP library...

Now, either am I a complete MORON or JavaC resolves everything using the
System classloader, completely ignoring whatever classloader loaded
itself? NOTICE: If this is true, we have a bunch of problems basically
everywhere we want to do some on-the-fly compilation (tomcat people
read: JSP!).

Well, now I'm tired of bashing my head on this (4:30 am and still
coding) so, I'd better get off to bed...

<signed author="Pier" comment="I'm tired"/>


View raw message