Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7641117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:50:33+00:00 2026-05-31T08:50:33+00:00

I am trying to execute a multithreaded program, using the Executors of Java. On

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T08:50:35+00:00Added an answer on May 31, 2026 at 8:50 am

    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

    public final Thread newThread(final Runnable r) {
        Thread newThread = threadFactory.newThread(r); // you can use default thread factory
        newThread.setName("threadName");
        newThread.setDaemon(Boolean.TRUE);
        newThread.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
            @Override
            public void uncaughtException(final Thread t, final Throwable e) {
                // log
            }
        });
        return newThread;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to write a part of a multithreaded program where each thread
Trying to execute WordCount example from cassandra and getting an error: Exception in thread
I'm trying to execute a windows command through cmd.exe in node.js using child_process.spawn. It
I`m trying to execute linux commant 'cat' from java code, but it does not
I am trying to execute DBCC CHECK DB('MyDB) using ADO.Net, but how can I
I'm trying to execute a long-running piece of code in a background thread and
I'm trying to execute an external program from inside my Linux C++ program. I'm
Trying to execute shell command in background using pythons commands module >>>import commands >>>output
I am trying execute a java class which accesses a method in a jar
Trying to execute a Powershell cmdlet from a MVC 3 Controller using impersonation but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.