This content has been marked as final.
Show 1 reply
-
1. Re: Accessing an MBean using RMIClientConnectorImpl
ranaaich Sep 15, 2003 10:50 AM (in response to ranaaich)I found a solution to this.
I'm using RMIConnector to connect to MBeanServer with the code as follows:
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
props.put(Context.PROVIDER_URL, "localhost:1099");
InitialContext ctx = new InitialContext(props);
String serverName = InetAddress.getLocalHost().getHostName();
String connectorName = "jmx:" + serverName + ":rmi";
_server = (RMIConnector)ctx.lookup(connectorName);
This code is working fine for me. So please consider this thread as closed.