0 Replies Latest reply on Dec 5, 2007 5:54 PM by Ryan Delucchi

    ClassLoader issues

    Ryan Delucchi Newbie

      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.