0

When I terminate my Java Application in Eclipse, it doesn't trigger the destroy() function but the application gets terminated.

Where and how can I capture Tomcat's shutdown (or Terminate button in Eclipse) in Java so that I could run the cleaning operations like closing threads etc.

AnR
  • 1,809
  • 3
  • 26
  • 45
  • 1
    Instead of eclipse try using tomcat directly from a command line and check the behaviour when you terminate Tomcat either with Ctl+c or shutdown.bat/sh. Far as I recollect, Tomcat calls the destry() method of servlets during context destroyed event – Ironluca Mar 13 '23 at 13:01
  • Which `destroy` method are you talking about? How do you know it's not being called? – Christopher Schultz Mar 30 '23 at 17:24

0 Answers0