2 Replies Latest reply on Jul 8, 2004 12:37 PM by Gerd Steinkamp

    Problems with HA-JNDI Lookup of DefaultPartition

    Gerd Steinkamp Newbie

      Hello,

      when I try to lookup the /HAPartition/DefaultPartition object in HA-JNDI I get a null object as result. There are no error messages during startup of server. I inspected the JNDI tree with JNDIExplorer and the object seems to be there. What am I doing wrong?

      Here is the code:

      public class RegisterServer {

      public static void main(String[] args) {
      Properties p = new Properties();
      p.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
      p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
      p.put(Context.PROVIDER_URL, "jnp://169.254.195.178:1100"); // HA-JNDI port.
      p.setProperty("jnp.partitionName","DefaultPartition");
      try{
      InitialContext ctx = new InitialContext(p);
      Object obj = ctx.lookup("/HAPartition/DefaultPartition");
      HAPartition myPartition = (HAPartition) obj;
      System.out.println(myPartition.getPartitionName());
      }catch (Exception e) {
      System.out.println(e.toString());
      }
      }
      }

      Cheers
      Gerd