cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pier P. Fumagalli" <pier.fumaga...@eng.sun.com>
Subject Re: WEB-INF classloading and on the fly compilation
Date Thu, 14 Sep 2000 22:48:31 GMT
cmanolache@yahoo.com wrote:
> 
> On Thu, 14 Sep 2000, Stefano Mazzocchi wrote:
> 
> > cmanolache@yahoo.com wrote:
> > >
> > > :-)
> > >
> > > You could also find the webapp root ( getRealPath("/") ) and compute the
> > > classpath yourself - but I would say this is worse, since you'll rely on a
> > > run-time directory structure that may not exist ( again, war file format
> > > is a deployment format, not a run-time format ).
> 
> > This works _ONLY_ if classloading is performed thru files... what
> > happens if I have a NetworkClassLoader a JDBCClassLoader or a
> > OnTheFlyAssembledClassLoader? no compiler existing today (I just checked
> > ALL the existing java compiler I could find!) would be able to compile
> > against classes loaded thru a classloader.
> 
> One would argue that compilation should happen at deployment, not at
> runtime.

Let's get real... More and more we're using on the fly compilation
because it has been proven to be an effective techniques... Now you're
saying that I can't do it within a servlet? And just because the
compiler works in a different way?

> > everything, ranging from a database to a compiler... so you don't go
> > shopping for tons of jar, but you just drop  the WAR on the webapp
> > folder and you're done. Period.
> >
> > The WAR packages were created for that right? Good, but this idea is
> > broken by the fact that all existing java compilers assume that classes
> > are loaded from disk.
> 
> You may have additional problems - even if you include a javac compiler in
> your WAR, the sandbox will not allow you to use it too much. Some servers
> may care about security ( well, I'm dreaming, nobody cares about that
> today :-).

What Cocoon does today is to write the JAVA files in the servlet work
directory (and I believe that's given in the specs), and perform a bunch
of security-legal operations (like constructing a ClassLoader with the
WEB-APP classloader as a parent... blablabla)...
The only "security constraint" such a WEB-APP would require is to be
able to construct  a classloader, and work in the work directory (even
if this last one can be avoided, doing basically everything in
memory)...

> > Damn, now I need to write a java compiler :(
> 
> Maybe an OS too - all those existing OSes that are using this bad
> filesystem concept ... :-)

We can hack them, though... If we have the sources.... :) :) :)

	Pier

Mime
View raw message