-
Bug
-
Resolution: Done
-
Critical
-
JBossAS-5.1.0.Beta1
-
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)
}
<?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[]
, new Class[] {boolean.class}};
String[] signature = new String[]
;
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)
assertTrue(((Boolean)resps.get(0)).booleanValue());
}