Result of is not a


  • Type: Defect Defect
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Patch:
    Code and Test
  • Approval:


The documentation suggests that you create a JMX bean ( by calling on a reference to a map whose values are the actual values you want as attributes: for instance, (create-bean (ref {:calls-so-far 0})). However, if you do this, when you get the attribute out using .getAttribute the result is the actual state value, and not the in question as the interface specifies. This also causes a ClassCastException when you try to call .getAttributes or anything else that tries to add the attributes to an AttributeList.

The attached patch fixes this problem by wrapping the state value in a call to Attribute. so that .getAttribute yields an Attribute, and modifies objects->data to descend into Attribute values accordingly. The tests work, and it works for my use case, but I do not know whether this is the right solution in general.


Nick Bailey made changes -
Field Original Value New Value
Attachment 0001-Return-a-list-of-Attribute-objects-from-.getAttribut.patch [ 11510 ]
Nick Bailey made changes -
Status Open [ 1 ] Resolved [ 5 ]
Assignee Chris Jeris [ bccjeris ]
Approval Accepted [ 10005 ]
Resolution Completed [ 1 ]
Patch Code and Test [ 10002 ] Accepted [ 10012 ]
Alex Miller made changes -
Patch Accepted [ 10012 ] Code and Test [ 10002 ]


Vote (0)
Watch (1)


  • Created: