2 Replies Latest reply on Jul 13, 2007 3:26 AM by Brian Schau

    Dynamic Class loading

    Brian Schau Newbie


      Having read through lots of posts, documents and pages found on Google and still having a, to me, strange problem, I turn to the gurus on jboss.org ...

      Situation: I start my main application from within jboss. My application will generate dynamic java classes outside the jboss directories.
      When the classes needs to be loaded the class loading fails with a "Class Not Found Exception".
      However, if I restart jboss and loads the previously generated classes everything runs smoothly.

      In the jboss-service.xml for the .sar I have a line:

      My classes are in a com.hp package and their name starts with Dyn{autogen-id}. The {autogen-id} is a autogenerated name based on a md5 sum of some of the properties of the class (path, name etc).

      A full path to a class would be:


      To find/load the class I use the following:

      class = Thread.currentThread().getContextClassLoader().loadClass("com.hp.DynXXX");

      So ... my question is: how do I "hot deploy" a class outside of the jboss directory hierarchy?

      Kind regards,