Fix on shutdown in a Tomcat container