If the remote-naming jar is part of a webapp (rather than on appserver or even system level), the use of the JVM shutdown hook added by org.jboss.naming.remote.client.CacheShutdown causes classloader leaks when the application is redeployed, as it will prevent the webapp's classloader from being garbage collected.