I have one answer, which should not be the answer. It works because my
class was loaded using the "correct" class loader.
In my finalize method, I use setContextClassLoader as follows:
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(this.getClass.getClassLoader())
;
}
catch (SecurityException e) {
//do something
}
finally {
Thread.currentThread().setContextClassLoader(oldClassLoader);
}
-----Original Message-----
From: Wax, Michael [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 20, 2001 4:56 PM
To: '[EMAIL PROTECTED]'
Subject: Classloader Problem
I am using Tomcat 4.0 with JBoss 2.4. I am able to call JBoss session beans
from my servlets without problem. However, when I attempt to call a session
bean from the finalize method of a helper class, I get a
ClassNotFoundException, no matter where I put my JBoss client classes. It
seems clear that the JBoss proxy classes are using the wrong class loader
when called from finalize. Any thoughts?
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>