This content has been marked as final.
Show 1 reply
-
1. Re: How to access secured JMX connection in JBoss from clien
plutus Mar 16, 2006 1:24 PM (in response to plutus)Hm,
with following piece of code it works. But why? could anyone please give me a link to a section where this is documented?
props.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
props.put(Context.PROVIDER_URL, url);
props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
// BEGIN
SecurityAssociation.setPrincipal(new SimplePrincipal("user"));
SecurityAssociation.setCredential("pass".toCharArray());
// END
Context ctx = new InitialContext(props);
RMIAdaptor rmiAdaptor = (RMIAdaptor) ctx.lookup("jmx/rmi/RMIAdaptor");
RMIConnectorImpl impl = new RMIConnectorImpl(rmiAdaptor);
conn = (MBeanServer) impl;
ctx.close();
// ...