HA-JNDI Namespace in JMX Console
marcreis Aug 31, 2006 6:49 AMI 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;
@Stateful
@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,
IDoSomeWorkSFSBLocal{
private String lastString="";
private String lastResult="";
public DoSomeWorkSFSB(){
}
public String mirrorString(String sText){
if(sText==lastString)
return lastResult;
lastString = sText;
lastResult = "";
for (int i=sText.length()-1; i>=0; i--){
lastResult += sText.charAt(i);
}
System.out.println(lastResult);
return lastResult;
}
}
Sincerly
Marc