Skip navigation.

Administration Console Online Help

  Previous Next vertical dots separating previous/next from contents/index/pdf Contents Index

Startup and Shutdown Classes

[Attributes and Console Screen Reference for Startup and Shutdown]

You can use startup and shutdown classes to configure a WebLogic Server to perform tasks when you start or gracefully shut down the server. A startup class is a Java program that is automatically loaded and executed when a WebLogic Server is started or restarted. For information about when WebLogic Server loads and executes startup classes, see "Ordering Startup Class Execution and Deployment."

A shutdown class is a Java program that is automatically loaded and executed when the WebLogic Server is shut down either from the Administration Console or the weblogic.admin shutdown command. For more information about when a server invokes startup and shutdown classes, refer to "Server Lifecycle."

To use startup or shutdown classes, you must configure and assign them to servers or clusters. BEA provides the examples.jms.startup API code example which demonstrates how to establish a JMS message consumer from a WebLogic startup class.

Note: WebLogic Server 8.1optionally installs API code examples in WL_HOME\samples\server\examples\src\examples, where WL_HOME is the top-level directory of your WebLogic Server installation. You can start the examples server, and obtain information about the samples and how to run them.

The following sections describe how to use startup and shutdown classes:

 


Configuring a Server to Use a Startup or Shutdown Class: Main Steps

To configure a server instance to use a startup or shutdown class, complete the following tasks:

Configure a Startup or Shutdown Class

  1. In the left pane, expand the Deployments folder.
  2. Click on the name of the Startup & Shutdown folder. (See Figure 360-1.)
  3. Figure 360-1 Click on the Name of the Startup & Shutdown Folder

    Click on the Name of the Startup & Shutdown Folder


     

    The Administration Console displays the Startup & Shutdown page. This page includes a list of the configurations that already exist in this domain. If any existing configuration is similar to the one that you want to create, consider cloning it. For more information, refer to Clone a Configuration of a Startup or Shutdown Class.

  4. On the Startup & Shutdown page, do one of the following:
  5. The Administration Console displays the set of tabs that you use to configure a startup or shutdown class.

  6. Enter values in the Name, Class Name, Deployment Order, and Arguments attribute fields. For more information about each field, refer to Attributes for startup classes or Attributes for shutdown classes.
  7. In the Arguments field, separate multiple arguments with a comma. For example,
    firstname=MyFirst,lastname=MyLast

    Do not use spaces to separate the arguments; use only a comma.

  8. If you want a startup class to load and execute:
  9. Click Create.
  10. The Administration Console adds your new configuration under the Startup & Shutdown node in the left pane.

  11. If you want to add a note that describes your configuration, click the Notes tab. Enter a note and click Apply.

When you are ready to make the configured class available to one or more servers, refer to Assign a Startup or Shutdown Configuration to Servers or Clusters.

Clone a Configuration of a Startup or Shutdown Class

  1. In the left pane, click the Startup & Shutdown node.
  2. The Administration Console displays the Startup & Shutdown page. This page displays a list of the configurations that already exist in this domain.

  3. On the Startup & Shutdown page, click the Clone icon in the row of the class you want to clone.
  4. The Administration Console displays the set of tabs that you use to configure a startup or shutdown class.

  5. Enter a value in the Name field.
  6. You can modify any of the values in the Class Name, Deployment Order, and Arguments attribute fields. You can also change the setting for the Abort Startup on Failure checkbox.
  7. Click Clone to create a configuration with the name that you specified in the Name field.
  8. The Administration Console adds your new configuration under the Startup & Shutdown node in the left pane.

  9. If you want to add or modify a note that describes your configuration, click the Notes tab. Enter a note and click Apply.

When you are ready to make the new configuration class available to one or more servers, refer to Assign a Startup or Shutdown Configuration to Servers or Clusters.

Assign a Startup or Shutdown Configuration to Servers or Clusters

  1. In the left pane, expand the Startup & Shutdown folder and click a configuration.
  2. The Administration Console displays the configuration in the right pane.

  3. In the right pane, click the Target and Deploy tab.
  4. If you have configured a cluster for the domain, the Target and Deploy tab displays a Clusters table, which lists all servers that are assigned to the cluster.

  5. To assign a startup or shutdown class to servers that are in a cluster, do the following:
    1. On the Target and Deploy tab, in the Clusters table, select the check box next to the cluster.
    2. To assign the class to all servers in the cluster, click the All Servers in the Cluster button. (See Figure 360-2.)
    3. To assign the class only to one or more specific servers, click the Part of the Cluster button. Then select the servers you want to target.

    When you deploy to all or part of a cluster, the Administration Console initiates a two-phase deployment. In general, such a deployment ensures that if the deployment fails for one active server, it fails for all active servers. For more information, refer to "Introduction to Two-Phase Deployment" and "Guidelines for Deploying to a Cluster."

    Figure 360-2 Deploy to an Entire Cluster

    Deploy to an Entire Cluster


     
  6. To assign the startup or shutdown class to servers that are not in a cluster, in the Independent Servers table, select one or more servers.
  7. If the deployment fails for one server, the Administration Console reports the error but continues deploying on any remaining servers that you selected.

  8. Click Apply.
  9. If you have not already done so, Add the Class to the Server's Classpath.
  10. Note that clicking Apply sets the value of the Server (or Cluster)—>Deployments—>Startup/Shutdown list for each server or cluster that you specified.

Add the Class to the Server's Classpath

The startup or shutdown class must be on the classpath of each server to which it is assigned. To add a class to a server's classpath, do one of the following:

 


Modify an Existing Startup or Shutdown Configuration

  1. In the left pane, expand the Startup & Shutdown node and click a configuration.
  2. The Administration Console displays the configuration in the right pane.

  3. On the Configuration tab, modify any of the values in the Class Name, Deployment Order, and Arguments attribute fields. You can also change the settings for the Failure is fatal or Run before application deployments checkboxes.
  4. Click Apply to save any changes.
  5. On the Notes tab, modify or add a note.
  6. Click Apply to save any changes.
  7. On the Targets tab reassign the configuration to different clusters or servers. To remove the configuration from a target, select the target in the Chosen column and click the mover control to move it to the Available column.
  8. Click Apply to save any changes.

 


Delete a Startup or Shutdown Class Configuration

  1. In the left pane, click the Startup & Shutdown node.
  2. The Administration Console displays the Startup & Shutdown page. This page displays a list of the configurations that already exist in this domain.

  3. On the Startup & Shutdown page, click the Delete icon in the row of a configuration.
  4. A dialog displays in the right pane asking you to confirm your deletion request.

  5. Click Yes to delete the configuration.

 

Skip navigation bar  Back to Top Previous Next