LIST + Object name doesn't seem to be working

classic Classic list List threaded Threaded
7 messages Options
Dan Dan
Reply | Threaded
Open this post in threaded view
|

LIST + Object name doesn't seem to be working

Hi- I'm trying to list out the attributes and operations of a specific MBean.  Using the LIST operation (in GET mode), I can get a list of ALL attrs/ops for a class of MBeans, but the requests break when type and name are added.  For example, this works:

/jolokia/list/java.lang

But these do not:
/jolokia/list/java.lang:type=OperatingSystem
/jolokia/list/java.lang/type=OperatingSystem

(Note: the above syntax works fine with READ requests).

The error shown is:
{"error_type":"class java.lang.IllegalArgumentException","error":"java.lang.IllegalArgumentException : Map key 'java.lang:type=OperatingSystem' is unknown for map {JMImplementation={type=MBeanServerDelegate={desc=Represents the MBean server from the management point of view., attr={ImplementationVendor={desc=the JMX implementation vendor (the vendor of this product)., type=java.lang.String, rw=false}, SpecificationVendor={desc=The vendor of the JMX specification implemented by this product., type=java.lang.String, rw=false}, ImplementationVersion={desc=The ...","status":400,"stacktrace":"java.lang.IllegalArgumentException: Map key 'java.lang:type=OperatingSystem' is unknown for map {JMImplementation={type=MBeanServerDelegate={desc=Represents the MBean server from the management point of view., attr={ImplementationVendor={desc=the JMX implementation vendor (the vendor of this product)., type=java.lang.String, rw=false}, SpecificationVendor={desc=The vendor of the JMX specification implemented by this product., type=java.lang.String, rw=false}, ImplementationVersion={desc=The ...\n\tat org.jolokia.converter.json.MapExtractor.extractObject(MapExtractor.java:53)\n\tat org.jolokia.converter.json.ObjectToJsonConverter.callHandler(ObjectToJsonConverter.java:259)\n\tat org.jolokia.converter.json.ObjectToJsonConverter.extractObject(ObjectToJsonConverter.java:233)\n\tat org.jolokia.converter.json.ObjectToJsonConverter.convertToJson(ObjectToJsonConverter.java:108)\n\tat

Am I doing something wrong?

Thanks,
Dan

P.S.  are there plans for adding LIST and SEARCH to the Java client?
roland roland
Reply | Threaded
Open this post in threaded view
|

Re: LIST + Object name doesn't seem to be working

Hi Dan,

list is a bit different in so far as it separates the domain properties part of an object name in two layers. The reason for this is to allow a more fine grained access and better grouping of the meta information. In the next version 0.91 to come, the list command has been reworked and also allows for a 'maxDepth' option to truncate the returned tree (e.g. very useful for MBean Browser which only want to load some layer of the tree).

So the proper syntax for using a path with list is:
/jolokia/list/java.lang/type=OperatingSystem

See also http://www.jolokia.org/reference/html/protocol.html#list for more information about the list command.
... roland
Dan Dan
Reply | Threaded
Open this post in threaded view
|

Re: LIST + Object name doesn't seem to be working

Roland- thanks for the quick reply.  The request URI you showed does indeed work for JVM MBeans but I can't seem to get it to work for custom MBeans.  For example, I have an MBean with a ON = AIP2:type=connection,name=5-135

All of the following request URI's fail with the error above:

jolokia/list/AIP2:type=connection
jolokia/list/AIP2:type=connection,name=5-135
jolokia/list/AIP2/type=connection
jolokia/list/AIP2/type=connection,name=5-135
jolokia/list/AIP2/type=connection/name=5-135

FWIW, this one does work (name and type reversed):
jolokia/list/AIP2/name=5-135,type=connection

All of that said, I can't seem to just pass a ON into the j4pRequest object (extended to provide LIST functionality) and have it return a value.

Cheers,
Dan

P.S.  Thanks for creating this very useful set of tools!
roland roland
Reply | Threaded
Open this post in threaded view
|

Re: LIST + Object name doesn't seem to be working

The second level of the list return value are key-value properties in the
so called canonical format (see here for details).

I.e. the keys are order in lexical order (i.e. "name" comes before "type").

Indeed, and I will add this probably to one of the next versions, to have an API which takes an ON in any form and produces the proper format for the list comm, would be a good things.

Thanks for spotting this.
... roland
roland roland
Reply | Threaded
Open this post in threaded view
|

Re: LIST + Object name doesn't seem to be working

BTW, what client API are you using (Java, Javascript or Perl) ?
... roland
roland roland
Reply | Threaded
Open this post in threaded view
|

Re: LIST + Object name doesn't seem to be working

In reply to this post by Dan
I forgot: LIST and SEARCH have been added to the Java client in 0.90 released last week.
... roland
Dan Dan
Reply | Threaded
Open this post in threaded view
|

Re: LIST + Object name doesn't seem to be working

I'm using the Java client lib.

Thanks for the clarifications.  I'll look at 0.9 immediately.