I am attempting to use the jmx4r library to set an MBean attribute.
method_missing': undefined methodactive =’
exception, when I attempt to set the attribute.
This error is strange, there should not be a white space between
‘active’ and ‘=’. The method to set the value should be ‘active=’, not
‘active =’
This may be due to an error in the description of the MBean.
What you can do:
check what attributes are exposed by the jmx4r mbean
irb> standby_mbean.attributes
check what is exposed by the Real JMX MBean object:
irb> JMX::MBean.pretty_print
“xxx.jmx.monitors:name=hydra.planb.cps,type=JmsQueueStatsMBeanFactory”
In you case, you should see a “Value” attribute which is both readable
and writable.
check what is exposed by the Real JMX MBean object:
irb> JMX::MBean.pretty_print
“xxx.jmx.monitors:name=hydra.planb.cps,type=JmsQueueStatsMBeanFactory”
very nice
In you case, you should see a “Value” attribute which is both readable
and writable.
writable is false and I am an idiot.
I then successfully invoked a JMX operation on the object returned
with MBean#find_by_name
Thanks
Aidy
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.