5 Replies Latest reply on May 5, 2010 3:49 PM by 843798

    Problem calling remote MBean: getting remote object reference

      I have a remote MBean and I'd like to invoke it.
      I have only the class of the remote MBean, I tried to get the instance of it in this way:
      JMXServiceURL u = new JMXServiceURL(
                            "service:jmx:rmi:///jndi/rmi://" + hostname + ":" + port +  "/GaiaJMXServer");
               JMXConnector c = JMXConnectorFactory.connect(u); 
               MBeanServerConnection msc=  c.getMBeanServerConnection();
               ObjectName name=new ObjectName("DPCT PFS Coordinator:name="+PropertyLoader.getProperty("node.registeringName"));
      nodeCoordinator=(PFSRemoteNodeCoordinator)MBeanServerInvocationHandler.newProxyInstance(msc, name, PFSRemoteNodeCoordinator.class, false);
      But in this way I receive an errore because PFSRemoteNodeCoordinator is a class and not an interface. I haven't got any interfaces for it, and with JConsole the class of this MBean is PFSRemoteNodeCoordinator.

      How can I get the reference to the remote object?
      Thanks, bye bye.