5 Replies Latest reply: May 5, 2010 10:49 AM by 843798 RSS

    Problem calling remote MBean: getting remote object reference

    843798
      Hi,
      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.