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:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to