[jboss-user] [Management, JMX/JBoss] - Remote JNDI Lookup on Remote MBean Server
price34
do-not-reply at jboss.com
Tue May 29 16:31:44 EDT 2007
I am trying to get a server connection to a remote MBean Server. I am using the following code:
MBeanServerConnection server = null;
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL, jndiUrl);
InitialContext ic = new InitialContext(env);
server = (RMIAdaptor) ic.lookup("jmx/invoker/RMIAdaptor");
When running the code on one of the remote servers I get a java.lang.ClassCastException on the lookup which is strange because RMIAdaptor actually extends the MBeanServerConnection. I think it is something else. When I run this code on my desktop against my local machine it works fine. But when I run this code on my local machine against a remote server I get a javax.nameing.CommunicationException.
Any help on how to query the Mbeans on a remote machine would be helpful?
FYI this code worked fine in all aspects with jboss 4.0.3 it is 4.0.4 that is giving me the problems.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049526#4049526
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049526
More information about the jboss-user
mailing list