简体   繁体   中英

How to solve java.util.concurrent.RejectedExecutionException jboss?

Hitting this error in jboss server:

Caused by:

java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@542f7a70 rejected from java.util.concurrent.ThreadPoolExecutor@42XXXXXX[Running, pool size = 10, active threads = 10, queued tasks = 0, completed tasks = 64491]
    at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2063)

Is it because the active threads is limited to 10? How to increase it?

  1. Don't display the shutdown method. For example, in Android, if you cancel AsyncTask in the Destory method, then no active thread in the thread pool will recycle itself.

  2. When calling the thread pool, determine whether it has been shut down, and determine it by the API method isShutDown. Sample code:

OR

Maybe your threads is over maximumPoolSize? is possable??

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM