1 Reply Latest reply on Oct 10, 2003 11:37 AM by breaston

    HAJNDI: Service unavailable problem.

    razvan.ludwig

      I use this code to create a subcontext in HAJNDI.

      Properties p = new Properties();
      p.putContext.INITIAL_CONTEXT_FACTORY,
      "org.jnp.interfaces.NamingContextFactory");
      p.put(Context.URL_PKG_PREFIXES,
      "jboss.naming:org.jnp.interfaces");
      p.put(Context.PROVIDER_URL, "WHATEVER"); // uses HAJNDI
      Context ctx = new InitialContext(p);
      try {
      subctx = ctx.createSubcontext("TESTCTX123");
      } catch(Exception e) {
      e.printStackTrace();
      }

      I always catch this exception:
      javax.naming.CommunicationException. Root exception is java.rmi.RemoteException: Service unavailable.

      If I only do lookup or rebind, everything works fine in the HAJNDI. If I change the PROVIDER_URL to point to the standard JNDI, I can also create a subcontext.

      I use JBoss 3.2.1, started with the "all" configuration. Can anybody tell me when this Exception occurs and how can I work around it ??