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

    Dynamic Class loading

      Hello,


      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:

      c:\HP\myapp\classes\com\hp\DynXXX.class

      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,
      Brian