This content has been marked as final. Show 2 replies
Looku[ the server connection via JNDI. To do this, replace your first line of code with the following:
Hashtable env = new Hashtable(); String factory = "org.jnp.interfaces.NamingContextFactory"; env.put(Context.INITIAL_CONTEXT_FACTORY, factory); String url1 = "jnp://localhost:1100"; env.put(Context.PROVIDER_URL, url1); Context ctx = new InitialContext(env); MBeanServerConnection mconn = (MBeanServerConnection)ctx.lookup("jmx/invoker/RMIAdaptor");
Thanks. In fact it was my mistake, the locateJBoss() was fine, but the objectName should have referenced JEMonitor as a service, not a name.