The JMXHelper in the samples currently adds an MBean connection server to an RMI registry service.
But it does not remove the MBean connection server when the jvm is shutdown. This can be an issue when a subsequent jvm starts and attempts to add an MBean with the same name. The RMI registry service will throw an exception.
This contribution adds a shutdown hook to the jvm when the JMXHelper is initialised.