0 Replies Latest reply on May 19, 2003 5:12 PM by Mike

    Dynamically Loading Classes.....

    Mike Newbie

      I am trying to load classes from a specified 'Hot Drop' directory with the following code..

      // Convert the file object to a URL
      URL url = getMyDir().toURL();
      urls = new URL[]{url};

      // Create a new class loader with the directory
      this.classLoader = new URLClassLoader(urls,Thread.currentThread().getContextClassLoader());

      When loading classes that refer to other objects that are deployed in the .war or .jar files I continually get 'ClassNotFoundException'. The ClassLoader that I am using is taking the current threads ClassLoader as a parent parameter. Should this not give the URLClassLoader visibility to the objects loaded by the appServer via the delegation model? If I place the dependent classes in the hot drop directory it expectantly it works. How do I get around this?