title: How to restart tomcat on unexpected but graceful shutdown
body: <p>first some context: Tomcat 7.0.42 / AJP/1.3 / httpd-2.2.15 / java 1.7.0_49 @ Windows Server 2008 R2 SP1 64bit</p>
  
  <p>With our previous tomcat installation (tomcat 6 / java 6) we sometimes encountered JVM crashes. Because of that we configured the tomcat service to "restart on error" which worked ok.</p>
  
  <p>Now with tomcat 7 sometimes the following error pops up (it is always the last entry in tomcat-err):</p>
  
  <pre><code>ClientAbortException:  java.io.IOException: Failed to send AJP message
  Caused by: java.io.IOException: Failed to send AJP message
  </code></pre>
  
  <p>which causes tomcat to shut down. This shutdown is apparently graceful, otherwise the "restart on error" setting would kick in, which it doesn't, so tomcat stays down :-(</p>
  
  <p>Is there a way to maybe add a listener which "System.exit(-1)"s when tomcat is shutting down gracefully and unexpectedly for this specific cause?</p>
  
  <p>Of course I'll try to track down the above error, but first I want to have means to keep tomcat up even when it unexcpectedly shuts down gracefully.</p>
  
  <p>cheers,
  alexander</p>