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

  • Home
  • SEARCH
  • 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 805571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:06:06+00:00 2026-05-15T00:06:06+00:00

I used Spring framework and oracle weblogic 10.3 as a container. I used workmanager

  • 0

I used Spring framework and oracle weblogic 10.3 as a container.
I used workmanager for manage my thread, I already made one thread that managed by workmanager. Fortunately spring provide the delegation class for using workmanager, so I just need to put it on applicationContext.xml.

But when I put the “while” and TimeUnit for sleep the process on desired delayed time, the deployment process never finished. It seems the deployment process never jump out from while loop for finishing the deployment.

Why?, As I know using typical thread, there is no issue like this. Should I use another strategy for make it always loop and delay.

import java.util.concurrent.TimeUnit;

import org.springframework.core.task.TaskExecutor;

public class TaskExecutorSample{
    Boolean shutdown = Boolean.FALSE;
    int delay = 8000;
    TimeUnit unit = TimeUnit.SECONDS;

    private class MessageGenerator implements Runnable {
        private String message;
        public MessageGenerator(String message){
            this.message = message;
        }

        @Override
        public void run() {
            System.out.println(message);
        }
    }


    private TaskExecutor taskExecutor;
    public TaskExecutorSample(TaskExecutor taskExecutor){
        this.taskExecutor = taskExecutor;
        try {
            while (shutdown.equals(Boolean.FALSE)){
                this.printMessage();
                unit.sleep(delay);
            }
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }

    public void printMessage() {
        taskExecutor.execute(new MessageGenerator("Print this Messages"));
    }
}

Really thanks in advance.
Regards,

Kahlil

  • 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-15T00:06:06+00:00Added an answer on May 15, 2026 at 12:06 am

    Well, the thread will wait for a bit more than 2h. Did you really wait that long for the deployment to finish?

    [EDIT] You’re probably doing the wait in the wrong place: You should wait in the run() method of the thread, not the constructor of the class.

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

Sidebar

Related Questions

I have used spring framework 3 for my application. Everything is ok while developed
What design patterns are used in Spring framework?
I'll be interviewing for a J2EE job using the Spring Framework next week. I've
We are looking at implementing a caching framework for our application to help improve
I am looking for a Java library/framework/technique of storing SQL statements in an external
I need to put an LDAP contextSource into my Java EE container's JNDI tree
my spring-hibernate application run without problem for the past 1 week , but suddenly
I am new to Spring and now a days I hear a lot about
I have Pythong2.6, psycopg2 and pgAdmin3 installed using Macports. My settings.py is: DATABASE_ENGINE =

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.