The JVM running the servlet container would terminate, so, yes. Well, System.exit() will terminate the current running JVM. So it is likely that the code written in servlet containers' addShutdownHook will be triggered. No you cannot because it will throw a security exception.