2 Replies Latest reply on Sep 1, 2006 4:39 AM by Marc Reis

    HA-JNDI Namespace in JMX Console

    Marc Reis Novice

      I have a cluster of two 4.0.4 and have been clustering for a while.

      Shortly I noticed that a new test app showed up under the HA-JNDI Namespace, before clustered beans didn?t do that.
      They always appeared in the Global Namespace. I didn?t bother with it before, since failover and load balancing still worked. I thought it was just a issue with the view...
      After changing a bit here an there on the test app, I at some time noticed that it disappeared form the HA-JNDI to the Global namespace again.
      All attempts to get it back under the HA JNDI have failed. The app works ok, but it just doesn?t show up. I did a minimal SFSB to try this again, with no luck.
      What config to I need to have, so that theoretically the Bean will land in HA JNDI? If it doesn?t show up there, does this mean the naming will run through HA-JNDI, find nothing, and then go through the Global namespace or is this just a "view" problem ?

      Just to show the class (Interfaces are omitted, there naked, just the one method and a field with the jndi name and a @Remote and @Local for the corresponding interface) :
      There is just annotation config, no ejb-jar.xml or jboss.xml in the META-INF .
      (I did try with them, and diverse settings in each of them. I guess if the problem is the config, I missed the right mix except that one time. I wanted to go simple, since in other apps I had the feeling that the mixing of annotation, ejb xml and jboss xml is at the moment not always working right).

      package de.somewhere.dummy.bean;
      import javax.ejb.Stateful;
      import org.jboss.annotation.ejb.Clustered;
      import org.jboss.annotation.ejb.LocalBinding;
      import org.jboss.annotation.ejb.RemoteBinding;
      import de.somewhere.dummy.interfaces.IDoSomeWorkSFSBLocal;
      import de.somewhere.dummy.interfaces.IDoSomeWorkSFSBRemote;
      @Clustered(partition= "DefaultPartition", loadBalancePolicy = org.jboss.ha.framework.interfaces.RoundRobin.class)
      @RemoteBinding(jndiBinding = "DUMMY/DoSomeWorkSFSB/remote")
      @LocalBinding(jndiBinding = "DUMMY/DoSomeWorkSFSB/local")
      public class DoSomeWorkSFSB implements IDoSomeWorkSFSBRemote,
       private String lastString="";
       private String lastResult="";
       public DoSomeWorkSFSB(){
       public String mirrorString(String sText){
       return lastResult;
       lastString = sText;
       lastResult = "";
       for (int i=sText.length()-1; i>=0; i--){
       lastResult += sText.charAt(i);
       return lastResult;



        • 1. Re: HA-JNDI Namespace in JMX Console
          Brian Stansberry Master

          You don't want an EJB to appear in the HA-JNDI namespace. If it does, something is broken.

          Each server binds a proxy for the EJB in JNDI. The HA-JNDI tree is a replicated namespace; that means if each server bound their proxy in it, at any time only one proxy would be bound -- the one from the last server to do the binding. That can lead to problems.

          If the EJBs are deployed homogenously across the cluster, the cost of having the HA-JNDI service check the HA-JNDI tree, find nothing, and then check the local JNDI tree on the machine handling the lookup is very low.

          • 2. Re: HA-JNDI Namespace in JMX Console
            Marc Reis Novice

            thanks for the fast reply. This clearifies the behavior. The doc left me somewhat unsure, after it did pop up in the HAJNDI. If it shouldn't be there, all is fine :) .