The problem is that shutdown hooks are called in a random order. If
Metrics is used in an application which itself uses a shutdown hook,
than it is quite possible that the JmxReporter will be shut down before
the primary parts of the the application is shut down. Which may or
may not cause an issue. Likely not, the application itself rarely
depends on JMX beans.
Why is it necessary to unregister MBeans when the JVM process is shutting down anyway?
I assumed your original question referred to this code in the Metrics class:
static {...Runtime.getRuntime().addShutdownHook(SHUTDOWN_HOOK);}
Runtime shutdownHooks are only invoked when the JVM process shuts down, not when the web application context alone is stopped or reloaded.
So unless I'm missing something it seems like shutting down the JMX reporter should be done in a ServletContextListener, like the already-existing MetricsServletContextListener does - which is why I am curious what the need would be to unregister MBeans in a non-web application if the JVM process is shutting down anyway.