After finding that FutureTask
running in a Executors.newCachedThreadPool()
on Java 1.6 (and from Eclipse) swallows exceptions in the Runnable
Have you tried using an UncaughtExceptionHandler?
UncaughtExceptionHandler
for pool threads, provide a ThreadFactory in the Executor.newCachedThreadPool(ThreadFactory)
call. setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler eh)
Submit the tasks with ExecutorService.execute, because only exceptions thrown from tasks submitted with execute
make it to the uncaught exception handler. For Tasks submitted with ExecutorService.submit any thrown exception is considered to be part of the task's return value. If a task submitted with submit terminates with an exception, it is rethrown when calling Future.get, wrapped in an ExecutionException