defining startup classes

Posted on 2005-05-03
Last Modified: 2013-12-10
I want to define a startup class which extends the thread class to do some work.
This needs to run on server shutdown as well to do any clean up.

How can this be done in weblogic 8.1
Question by:inzaghi
    LVL 10

    Accepted Solution


    can you clarify a little bit what you want to do with threads ?

    Anyway, follow this link to see how to create and deploy your startup class :


    Expert Comment

          Creating startup class for weblogic is quite easy. You can easily do it from the weblogic console. As described in the article
          But what I understand from your brief question is that you want to invoke a class which does a cleanup when the weblogic server is shutting down. And you want to extend the thread class for your startup class, because you want the cleaning up to continue parallel to the shutdown.
          There is a little code that will help you to create your startup class. Here startTestClass is your start up class and it calls the Cleanup class that extends Thread class. The code below will help you to create the startup class. You can play with the thread to do what you desire.
                   i hope al this helps you. let me know.

    import javax.naming.*;
    import weblogic.common.*;

    public class startTestClass  implements T3StartupDef
          public void setServices(T3ServicesDef services) {}

          public String startup(String name, Hashtable args) throws Exception
               System.out.println("Startup class invoked - " + name);
                Cleanup objCleanup =new Cleanup ();
                catch(InterruptedException exInterrupted)
                return "ok";

    class objCleanup extends Thread      
          public void run()
                //Put your cleaning up code here.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Verbose logging is used to diagnose garbage collector problems. By default, -verbose:gc output is written to either native_stderr.log or native_stdout.log.   It is also possible to redirect the logs to a user-specified file. This article will de…
    This exercise is about for the following scenario: Dmgr and One node with 2 application server. Each application server contains it owns application. Application server name as follows server1 contains app1 server2 contains app1 Prereq…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now