Re: [Ikvm-developers] Javassist
Brought to you by:
jfrijters
|
From: Jeroen F. <je...@su...> - 2006-08-26 11:42:26
|
Mark Wielaard wrote: > On Tue, 2006-08-01 at 22:54 +0200, Jeroen Frijters wrote: > > Kaushal Patel wrote: > > > Caused by: javassist.NotFoundException: java.lang.Object > > > at javassist.ClassPool.get (ClassPool.java:295) > >=20 > > Javassist tries to load the class files for the core classes (in the > > above case it is looking for java/lang/Object.class). Since=20 > IKVM doesn't > > have any Java class files for the core classes, this fails. > >=20 > > I don't know how to work around this, you could try asking the > > Javassist/Hivemind/Tapestry developers if there is a way to=20 > explicitly > > point it to an rt.jar. It may be as simple as pointing the CLASSPATH > > environment variable to an rt.jar. >=20 > FYI this is very similar to a libgcj bug report by Anthony=20 > Green (CCed): > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D15474 > As he points out there are some applications which seem to=20 > depend on the > class byte code of the classes from the bootstrapclassloader available > somehow. Bryce and I argued that this is not a sane thing for=20 > a program to depend on (like ikvm, gcj has a completely different=20 > execution model for its core classes). But if this pops up more often > maybe some way to provide a byte code version of these classes through > getResource() might still be needed. Note that all instances of this > have been some "sanity check" in a testsuite, not real application code. > I haven't yet looked at what javassist does. I've since implemented a workaround for this. getResource will now synthesize a .class file for the corresponding class (using reflection). For the code see http://ikvm.cvs.sourceforge.net/ikvm/ikvm/classpath/ikvm/internal/stubge n/StubGenerator.java?view=3Dmarkup I've tested this with Javassist and it appears to work (at least for a simple demo that they include). Regards, Jeroen |