commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johan Lindquist <jo...@kawoo.co.uk>
Subject Re: [HiveMind] RE: Broken test ...
Date Thu, 11 Sep 2003 13:02:56 GMT
On Thu, 11 Sep 2003 14:54:11 +0200, Essl Christian 
<jucas@esslchristian.de> wrote:

>
>>> 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.

My bad - the class was javassist.ClassPool.SimpleLoader ... But anyway, 
you're right - about 12 hours out of date code ... :) It works now, thanks 
for the help.

Johan

> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>



-- 
you too?

Mime
View raw message