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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top