Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-6792

callMethodOnPartition on MBeans extending HAServiceMBeanSupport not working

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • JBossAS-5.1.0.CR1
    • JBossAS-5.1.0.Beta1
    • Clustering
    • None

      Trying to call a method cluster wide on a service that extends HAServiceMBeanSupport fails with a
      message like this:

      2009-04-15 18:22:12,325 ERROR [org.jgroups.blocks.MethodCall] (Incoming-19,127.0.0.3:47610) found no method called echo in class org.jboss.ha.framework.server.HAServiceImpl$RpcHandler with (java.lang.Boolean) formal parameters

      Looks like the handler linked in HAPartition is not the correct one or not able to cope with remote
      method calls.

      Example:

      public interface EchoMBean extends HAServiceMBean
      {
      boolean echo(boolean echo);
      }

      public class Echo extends HAServiceMBeanSupport implements EchoMBean
      {
      public boolean echo(boolean echo)

      { return echo; }

      }

      <?xml version="1.0" encoding="UTF-8"?>

      <server>
      <mbean code="org.jboss.test.cluster.rspfilter.Echo" name="cluster.rspfilter:service=Echo">
      <attribute name="HAPartition"><inject bean="HAPartition"/></attribute>
      </mbean>
      </server>

      public void testTrueEcho() throws Exception
      {
      MBeanServerConnection[] adaptors = this.getAdaptors();
      ObjectName on = new ObjectName("cluster.rspfilter:service=Echo");
      Object[] args = new Object[] {"echo", new Object[]

      {true}

      , new Class[] {boolean.class}};
      String[] signature = new String[]

      {String.class.getName(), Object[].class.getName(), Class[].class.getName()}

      ;
      List resps = (List) adaptors[0].invoke(on, "callMethodOnPartition", args, signature);
      log.debug("Response list: " + resps);
      assertEquals(1, resps.size());
      if (resps.get(0) instanceof Exception)

      { throw (Exception)resps.get(0); }

      assertTrue(((Boolean)resps.get(0)).booleanValue());
      }

              pferraro@redhat.com Paul Ferraro
              rh-ee-galder Galder ZamarreƱo
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: