0 Replies Latest reply on Jul 9, 2009 9:41 PM by Chris Au

    ESB Class loading algorithm

    Chris Au Newbie

      Hi all,

      I have a self-written class that I want to use in ESB, I put the compiled class in a jar that was deployed via a esb called common.esb, and then two other esb depends on common.esb and tried to use the self-written class (say , first.esb and second.esb).

      In the self-written class, there is a resource-bundle that tries to read from a file called :config.properties, here is the init code of the self-written class :

      public class FTPUploadAction extends AbstractActionLifecycle{
      private static String CONFIG_PROPERTY = "config";
      private ResourceBundle res = null;
      protected ConfigTree _config;
      public FTPUploadAction(ConfigTree config){
      _config = config;
      init();
      }
      private void init(){
      try{
      if(res == null){
      res = ResourceBundle.getBundle(CONFIG_PROPERTY);
      }
      }
      catch(Exception e){
      System.out.println("Exception is caught while trying to init FTPUploadAction : " + e);
      e.printStackTrace();
      }
      }
      ...
      }

      I put config.properties in each of the first.esb and second.esb with different values.

      The problem is that, if first.esb is deployed first, the config.properties under first.esb will be loaded and second.esb will use the same values instead of reading from her own config.properties

      May I know if it is my programming problem? So how am I supposed to use different configuration files for different instances?

      Thanks a lot and sorry for my long post.