Hi everyone. I'm using Tomcat (4.1) and Axis 1.2 to provide a web service interface to a classical 2-tier application. My problem is, I need to access the existing API of this application, a single jar located outside the tomcat install. Copying this jar inside tomcat commmon lib dir or webapp lib dir is not permitted. Since tomcat gets rid of the system classpath, my first thought was to use a custom classloader, making the WebAppClassLoader his parent, and then set the context class loader with this new classloader : Thread.currentThread().setContextClassLoader(myClassLoader);
But it doesn't work. The myClassLoader.loadClass("JarUrl") works fine but I still have a NoClassDefFoundError when I try to use directly a class from the jar. Here is the code : URLClassLoader classloader = new URLClassLoader( new URL[] { new URL(classpath)} , Thread.currentThread().getContextClassLoader() ); Thread.currentThread().setContextClassLoader(classloader); classloader.loadClass("mc.mis.batch.BatchParams"); => ok, returns the good Class object mc.mis.batch.BatchParams batchParam = new mc.mis.batch.BatchParams(); => NoClassDefFoundError If someone has an other idea, or know what is wrong, I would thank him forever. Fabien --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]