2 Replies Latest reply on Jul 1, 2005 6:34 AM by canghel

    Problem calling a method on a remote MBeanServer Proxy (jbos

    canghel

      Hi,

      after moving from jboss 3.2.6 to 3.2.7 I encounter the following problem in the following scenario:

      1. I retrieve the MBeanServer from another cluster node using the code below:
      Hashtable env = new Hashtable();
      env.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
      if (ipAddress.indexOf(":") >= 0) {
      env.put("java.naming.provider.url", MessageFormat.format("jnp://{0}", new String[] { ipAddress }));
      }
      else {
      env.put("java.naming.provider.url", MessageFormat.format("jnp://{0}:1099", new String[] { ipAddress }));
      }
      env.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
      Context c = new InitialContext(env);
      RMIAdaptor a = (RMIAdaptor) c.lookup("jmx/rmi/RMIAdaptor");
      return new RMIConnectorImpl(a);

      2. I call from the current cluster node (not from a client but from a server node) the method <isRegistered(objectName)> on the remote mbeanserver proxy retrieved in step 1 to check whether an MBean with the given object name is available on the remote mbean server.

      The problem is that this call returns false even tough the respective MBean is registered on the respective remote mbean server. This worked fine when using jboss 3.2.6. Does anyone know what happend in 3.2.7?
      I assume that the call is performed locally and not on the remote MBean server and since the MBean with the given object name is available only on the remote server and not on the local one the method evaluates to false.
      How should one call a method on a remote mbean server (retrieved based on a given IP) and be sure that the method is invoked against the remote mbean server?

      Is this a bug in 3.2.7? Is there another way in 3.2.7 to make the same thing i.e. get the remote mbean server and call a method on it?

      Thanks,
      Claudiu Anghel