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 6586375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:46:58+00:00 2026-05-25T16:46:58+00:00

Background: I need to use java.util.concurrent.Executor to serialize the execution of some legacy code

  • 0

Background:

I need to use java.util.concurrent.Executor to serialize the execution of some legacy code inside a WebService.

I have added an member variable, executor, to the WebService class. It is injected from the outside by the springframework.

The executor bean is defined as such:

<bean id="riskValueEstimateUpdateExecutor" scope="singleton"
        class="java.util.concurrent.Executors"
        factory-method="newSingleThreadExecutor" />
  • Tomcat version: 6.0.22
  • Java version: 1.6
  • spring framework: 2.5.5

Problem:

The WS works as expected. We rolled it out to a linux server. Then we realised the tomcat stop script could no longer stop the service.

I use kill -3 to the tomcat instance. In the thread dump I find these lines:

"pool-2-thread-1" prio=10 tid=0xad637c00 nid=0xf37 waiting on condition [0xae882000..0xae883020]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0xb453b710> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:358)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:946)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:906)
        at java.lang.Thread.run(Thread.java:619)

How can I fix this problem?

If you need more information, please suggest.

  • 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-25T16:46:59+00:00Added an answer on May 25, 2026 at 4:46 pm

    It’s neither Tomcat’s nor Spring’s fault. You just have to shutdown ExecutorService properly. Add destroy-method in bean definition:

    <bean id="riskValueEstimateUpdateExecutor" scope="singleton"
        class="java.util.concurrent.Executors"
        factory-method="newSingleThreadExecutor" destroy-method="shutdown"/>
    

    BTW singleton scope is default. You might also consider using shutdownNow() method. Also note that Spring provides powerful task scheduling mechanism.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In short, my need is to have a background Image in my java app,
All, Need some help here. I am from a purely Java background and don't
I need some direction how to best use Exceptions in a Java EE environment,
Background We need to develop a specialised CMS (internal use only) to support a
I need to make a Java component that turns the background a certain colour
I have a java web application wired using Spring on Tomcat. I need a
I have some data I need to present to a user in a very
I am new to iPhone. Basically I am from Java background. What I need
Coming from a Java background, I want a class to have certain attributes and
update: some background - i use the xml file to generate a set of

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.