Thanks Marco. Nicholas has committed your suggestion in Cactus 1.3. I
wanted to give you credit for this as I don't think we've thanked you
for this brilliant idea ! So here's an official thank you ! :-)

-Vincent

> -----Original Message-----
> From: Marko Balabanovic [mailto:[EMAIL PROTECTED]]
> Sent: 13 February 2002 09:43
> To: [EMAIL PROTECTED]
> Subject: Switching to context ClassLoader?
> 
> I've noticed a few questions on the Cactus lists about the default
> ClassLoader used by AbstractTestCaller failing to find test cases.  I
> just encountered this problem myself.  In my case I think it was due
to
> the way that library jar files are deployed in our Weblogic 6.1
> setup---I suspect they may be loaded by a different ClassLoader, so
they
> don't have access to all the other classes in the WAR file.
> 
> I seem to have fixed the problem by changing AbstractTestCaller,
method
> getTestClassClass from this:
> 
>   testClass = Class.forName(theClassName);
> 
> to this:
> 
>   ClassLoader classLoader =
> Thread.currentThread().getContextClassLoader();
>   if (classLoader != null) {
>       // Found class loader for this thread
>       testClass = Class.forName(theClassName,true,classLoader);
>   } else {
>       // Using default class loader
>       testClass = Class.forName(theClassName);
>   }
> 
> In my case, it finds
weblogic.utils.classloaders.ChangeAwareClassLoader,
> which in turn finds my test cases just fine.  The default class loader
> doesn't.
> 
> Has anyone else looked at this?  Is this a change that has been
> considered for the new version of Cactus?
> 
> Thanks for any feedback,
> 
> Marko Balabanovic
> 
> --
> To unsubscribe, e-mail:   <mailto:cactus-dev-
> [EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:cactus-dev-
> [EMAIL PROTECTED]>
> 




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to