Discussion:
[Openjmx-devel] OpenJMX and RI Examples - RelationService
Roger Holbrook
2002-01-24 00:11:05 UTC
Permalink
Trying to run the RI RelationService example with OpenJMX produces
a problem with introspection.

Specifically, if an instance of the RelationService has been successfully
registered with the server, the following call:

Object[] params1 = new Object[0];
String[] signature1 = new String[0];
ArrayList relTypeNameList = (ArrayList)
(server.invoke(relServObjName,
"getAllRelationTypeNames",
params1,
signature1));

will produce a stack trace like:

javax.management.ReflectionException:
nested exception is java.lang.NoSuchMethodException: getAllRelationTypeNames
java.lang.NoSuchMethodException: getAllRelationTypeNames
at openjmx.MBeanIntrospector.findStdOperationMethod(MBeanIntrospector.java:510)
at openjmx.MBeanIntrospector.invoke(MBeanIntrospector.java:212)
at openjmx.MBeanServerImpl.invoke(MBeanServerImpl.java:158)
at RelationAgent.printRelationTypeInfo(RelationAgent.java:794)
at RelationAgent.doSimpleDemo(RelationAgent.java:179)
at RelationAgent.main(RelationAgent.java:87)

Within MBeanIntrospector the code looks like:

MBeanIntrospector.invoke()
{
if (isDynamic(mbean))
{
}
else
{
// Find the operation
Method operation = findStdOperationMethod(mbean, methodName, parameters);

// but no attempt to find a match among the attributes!!!
// PROBLEM
}
...
}

Roger
Bordet, Simone
2002-01-24 06:11:05 UTC
Permalink
Hi Roger,
Post by Roger Holbrook
Trying to run the RI RelationService example with OpenJMX produces
a problem with introspection.
Specifically, if an instance of the RelationService has been
successfully
Object[] params1 = new Object[0];
String[] signature1 = new String[0];
ArrayList relTypeNameList = (ArrayList)
(server.invoke(relServObjName,
"getAllRelationTypeNames",
params1,
signature1));
[snip]

This is a bug in the RI :)
The specification forbids to call attributes through invoke; getAttribute must be used instead.
This has been confirmed on also in jmx-forum.

Simon

Loading...