gcj-compiled jigsaw is running

Mark Wielaard mark@klomp.org
Tue May 1 10:29:00 GMT 2001


Hi,

On Tue, May 01, 2001 at 12:57:05PM -0400, Jeff Sturm wrote:
> On Tue, 1 May 2001, Nic Ferrier wrote:
> > Servlet containers have their own paths for finding servlets. The
> > servlet must be loaded from these paths. 
> > 
> > This is normally achieved by constructing a chain of CLs which
> > delegate (eventually) to the SystemCL.
> 
> I understand however that a class search must start with the parent
> classloader.  That prevents a derived classloader from overridding a
> system class, for example.
Yes. But the classloaders can be arranged in a tree.
Multiple classloaders can have the same parent. If they define the
same class (name) then for the runtime system they are different
classes (they don't override each other).

> > This is the reason Paperclips was built with a modular CL
> > architecture. So that it was possible to plug in a GCJ compiler CL
> > later on with out any mucking about with GCJ.
> 
> It seems to me that it is a feature of gcj that compiled classes can
> only be loaded once.  I don't understand how Paperclips can overcome that
> limitation.
If the primordial/bootstrap classloader is the only classloader that
can load natively compiled classes then it would indeed be impossible
to reload or redefine such a class with another classloader.

But can the "magic" that is done in natClassLoader.cc,
gnu::gcj::runtime::VMClassLoader::findSystemClass,
only be done in the system classloader?

It seems that it is using something called "GNU libltdl, a system independent
dlopen wrapper for GNU libtool". I don't know anything about loading and
linking libraries on Unix systems. Maybe it is possible to load and link
symbols from libraries in different "namespaces" (classloaders can be seen
as different namespaces for classes with the same name). But I have no idea
how linking would work in such a case. Does anybody know what documentation
I can read to get up to speed with Unix dynamic library linking?

Cheers,

Mark
-- 
Stuff to read:
    < http://www.toad.com/gnu/whatswrong.html >
  What's Wrong with Copy Protection, by John Gilmore



More information about the Java mailing list