• Post Reply Bookmark Topic Watch Topic
  • New Topic

ThreadpoolExecutor error  RSS feed

 
manisha makwana
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
here is my code.This code always give the following error

java.util.concurrent.RejectedExecutionException
at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.reject(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.execute(Unknown Source)


final ArrayBlockingQueue<Runnable> queue = new ArrayBlockingQueue(3);
ThreadPoolExecutor threadPool = new ThreadPoolExecutor(1, 3,30000, TimeUnit.SECONDS, queue);

threadPool.execute(new ResumeParserAPI(resumePath,userData,resumeServiceURL,userSession,service,attachmentURL));
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you see the javadocs for ThreadPoolExecutor, there is a section for Rejected Tasks. Can you find a reason there why your threadpool will reject tasks?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!