commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Essl Christian <ju...@esslchristian.de>
Subject Re: [HiveMind] RE: Broken test ...
Date Thu, 11 Sep 2003 12:54:11 GMT

>> The problem i am getting is when I try to add an interceptor to the 
>> service.  The class loader used by javassist to compile the class is 
>> it's own one - javassist.ClassPool.SimpleClassLoader, not the class 
>> loader used in this case to bootstrap the system.
>>
>> So it can't find the classes (in this case the 
>> AbstractLoggingInterceptor) already loaded by the URL class loader when 
>> creating the intercepted classes - the call to 'return 
>> _pool.writeAsClass(_ctClass.getName());' in ClassFabImpl#createClass 
>> fails with an NoClassDefFoundException.  I added some debug and just 
>> before the call to the writeAsClass method, the 
>> AbstractLoggingInterceptor can be loaded.
>>
>> It may be that I am trying to be too clever here - maybe it is best to 
>> have the classpath defined on the command line - or move the application 
>> into an application server.

Actually I can't find the class javassist.ClassPool.SimpleClassLoader. If 
you mean
javaassist.ClassPool.LocalClassLoader I think the problem has been 
resolved. HiveMind does not use
the method ClassPool.writeAsClass(). Rather it provides the 'bootstrap' 
ClassLoader (the one of ClassResolver) to load the class.

The method writeAsClass() and the method ClassPool.forName() are the only
ones in ClassPool which use the internal ClassPool ClassLoader. Because 
HiveMind does not use any of them (and should not do in the future) the 
'bootstrop' ClassLoader is used.

It would be nice if you could check your code again with a snapshot taken 
freshly from the CVS. Thanks. 

Mime
View raw message