While trying to display an MBean operation defined in a Dynamic MBean by a custom MBeanInfo.
In this MBeanOperationInfo, if the returnType element is set to null, the JConsole fails to display the operation and a pop-up error window with no message is displayed.
Just use Void.TYPE.getName() instead of <null>
It appears that the <null> value is not supported by JMX specifications for the returnType element of one MBeanOperationInfo.
1. The JConsole handles this special case and consider the <null> value as a Void type
2. The JConsole tests the returnType element and throw an Exception if it is <null>
The second approach seems best since it would trigger the developer to write a better MBeanInfo while first solution will somewhat "hide" the real problem form the developer.
JConsole should display the operation with null as return value such that
it doesn't prevent the user from invoking the operation however it should
log a warning about this fact.