enebo/jmx

JMX::MBeanProxy#method_missing is broken

tobias opened this issue · 3 comments

It currently calls java_args(args), instead of java_args(signature, args). I would fix it, but I don't know what signature should be in this case.

You are correct that something is not correct there.....but.....did you run into something which hit method_missing? I am thinking I should just remove the method_missing hook since all operations and attriibutes are defined on initialization of the MBeanProxy. Thoughts on this? I am thinking it is a vestigial organ. If not then I need to rediscover why it is needed and then add a test for it.

No, I only hit it because we expose a runtime pool via an MBean in TorqueBox that allows for arbitrary debug code evaluation (via Ruby#evalScriptlet()), and calling a top level non-existent method inside the script passed to evalScriptlet() raises a NoMethodError, which appears to bubble up and trigger MBP#method_missing. As a workaround, I'm actually overriding method_missing on the MBean object to raise NoMethodError. I have no need for method_missing on the MBean, so feel free to cut it off.

I cannot see how that method could still be used so I removed it. As it was written it wouldn't work anyways....so blam!

Fixed and released as version 0.7 of gem. Thanks for the report.