I have the following issue and I would like to know what exactly happens. I am using Java\'s ScheduledExecutorService to run a task every five minutes. It works very well. E
This man had the same problem.
http://code.nomad-labs.com/2011/12/09/mother-fk-the-scheduledexecutorservice/
His solution is to catch Exception inside the runnable and re throw an RuntimeException:
try {
theRunnable.run();
} catch (Exception e) {
// LOG IT HERE!!!
System.err.println("error in executing: " + theRunnable + ". It will no longer be run!");
e.printStackTrace();
// and re throw it so that the Executor also gets this error so that it can do what it would
// usually do
throw new RuntimeException(e);
}