I have two nodes(n1, n2) running the all configuration with HAJNDI service 
enabled. The org.jboss.ha.jndi.HANamingService mbean in cluster-service.xml has 
the default configuration. I'm using jboss-4.0.3SP1.

I have the following source code to remotely access the mbean server via 
RMIAdaptor:

// initial context
Hashtable jndiProperties = new Hashtable();
jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
jndiProperties.put(Context.PROVIDER_URL, jnp://n1:1099);
jndiProperties.put(Context.URL_PKG_PREFIXES, jboss.naming:org.jnp.interfaces");
//jndiProperties.put("jnp.disableDiscovery", "true");
InitialContext ic = new InitialContext(jndiProperties);

// connecting to mbean server
MBeanServerConnection server = (MBeanServerConnection) 
ic.lookup("jmx/invoker/RMIAdaptor");

//get host info
ObjectName name = new ObjectName("jboss.system:type=ServerInfo");
System.out.println("Host name: " + server.getAttribute(name, "HostName"));


I got inconsistent output, it might be
Host name: n1, or
Host name: n2

Even I uncomment out
//jndiProperties.put("jnp.disableDiscovery", "true");
it still gave inconsistent output.

Is this expected behavior? And how can I get a reference to the RMIAdaptor for 
the node n1 consistently?

Please help. Thanks. 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3921260#3921260

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3921260


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to