3 Replies Latest reply on Mar 31, 2005 4:02 AM by Dimitris Andreadis

    JBoss manage an MBean on remote JVM - PLEASE Help

    Shuki Lehavi Newbie

      Hi All,

      I have the following setup:
      1) A clustered JBoss 4.0.1 environment running on Linux servers.
      2) A java client that delegates calls to an OCX running on a separate Windows box. This client is written as an MBean and is invoked by a JMX Agent. I would like to have the MBeanServer on the JBoss cluster register this remote MBean.

      During the migration from 3.2.7 to 4.0.1 I lost the ability to have the JBoss MBeanServer on the Linux box, control the MBean exposed on the remote Windows box. This was due to the fact that RemoteMBeanServer was removed and replaced by MBeanServerConnection, and the latter does not expose the registerMBean method.

      In JBoss 4.0.x, how would you go about registering a remote object (MBean) with the JBoss MBeanServer? Any ideas or suggestions?

      Thanks in advance,


      Here is a sample of the code I used in 3.2.7

      // this code was running on the Windows pc/ server
      // get the context to lookup the JNDI of the remote JBoss running on Linux
      Context ctx = new InitialContext(env);
      // Use RemoteMBeanServer to get a handle to the MBeanServer:
      RMIAdaptor adaptor = (RMIAdaptor) ctx.lookup(dataProps.getProperty(JBOSS_RMI_ADAPTOR_JNDI_NAME));
      RemoteMBeanServer server = new RMIConnectorImpl(adaptor);
      // Start an instance of the MBean localy (i.e. on the Windows PC JVM)
      JMSThreadPool pool = new JMSThreadPool();
      // Register the local MBean to be managed by the remote JBoss cluster :
      server.registerMBean(pool, jmsThreadPoolBeanObjectName);