Question

I am trying to get a JMX MBean operation to return something other than "Method successfully invoked", from JConsole. When an exception occurs in the invoked method, I would like to see "Method failed" from JConsole, rather than "Method successfully invoked". Is there anything I can do in my MBean to make this happen?

Was it helpful?

Solution

JMXConsole, to my knowledge, will not report the method successfully invoked, unless it was. It sounds like the exception is being trapped in your target JMX invoked method, or somewhere in the path of execution of that method. Make sure you allow your exceptions to bubble up and eventually, the JMX layer will pick an exception type to wrap it in, usually javax.management.MBeanException if it was a generic exception.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top