0

My ScheduledExecutorService runs a few jobs. Initially all inserts to Oracle work fine but they eventually start to fail silently (no errors in tomcat logs). On shutdown of tomcat, I get these warnings:

 - web application [myapp] appears to have started a thread named [oracle.jdbc.driver.BlockSource.ThreadedCachingBlockSource.BlockReleaser] but has failed to stop it...
 - web application [myapp] appears to have started a thread named [InterruptTimer] but has failed to stop it....

As advised, my lone ojdbc8.jar is in CATALINA_HOME/lib and I've tried several permutations of shutdown(), shutdownNow() in ServletContextListener.contextDestroyed()

There are no other webapps deployed. There is no sign of trouble in the Oracle logs.

mrcrag
  • 310
  • 3
  • 16
  • (A) See [my Answer](https://stackoverflow.com/a/24902026/642706) to learn about exceptions that percolate up to executor service halting further task executions. – Basil Bourque Aug 19 '21 at 21:08
  • (B) You must properly shutdown your executor service or else the backing thread pool may continue like a zombie ‍♂️. See my Question, [*Hook for my Vaadin web app starting and stopping?*](https://stackoverflow.com/q/36588743/642706). The Answer there applies to any Java Servlet web app, not just [*Vaadin Flow*](https://vaadin.com/flow). – Basil Bourque Aug 19 '21 at 21:10
  • Alternatively, use a web app server that supports [*Jakarta Concurrency*](https://jakarta.ee/specifications/concurrency/) to automatically handle launch & shutdown of executor service and its backing thread pool. Tomcat & Jetty lack this facility. See products like TomEE, Glassfish, Payara, Open Liberty, JBoss, WildFly, and such. – Basil Bourque Aug 19 '21 at 21:14

0 Answers0