[jboss-user] [Installation, Configuration & DEPLOYMENT] - ClassLoader issues
do-not-reply at jboss.com
Wed Dec 5 17:54:34 EST 2007
My web application (which is deployed under JBoss) is throwing a lot of exceptions and they appear to all be instances where calls to java.lang.Class.forName() is failing.
After some googling I have found the following info:
If you use Class.forName() this is MyClass?.class.getClassLoader().loadClass(...) which will start from the classloader where your class is deployed.
You should use Thread.currentThread().getContextClassLoader().loadClass(...) to load from the current application's classloader.
Is this accurate? I *really* would prefer *not* to modify the entire code-base to access the ClassLoader differently.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4110689#4110689
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4110689
More information about the jboss-user