I am trying to execute a multithreaded program, using the Executors of Java. On execution the java thread terminates abnormally. I caught the exception , through try-catch, however, the exception has no message in it (null).
The failure is random, however I “suspect” that the failure is happening after I have made function calls in that thread. I tried to increase the thread stack size to 1024/2048 , but the result remains same.
Can someone please point out to the debugging approach to be adopted here. Since, I do not have the info about the exception I am not able to proceed with it.
I am working in Windows 64-bit environment, with java 1.6
While using the Executors class to create the thread pool use the method that accepts ThreadFactory; example
ExecutorService newFixedThreadPool(int nThreads, ThreadFactory threadFactory).In your implementation of the ThreadFactory, assign an UncaughtExceptionHandler; example below