bea.com | products | dev2dev | support | askBEA
 Download Docs   Site Map   Glossary 
Search

Configuring and Managing WebLogic Server

 Previous Next Contents Index View as PDF  

Server Lifecycle

At any time, a WebLogic Server instance is in a particular operating state. Commands—such as start, stop, and suspend—cause specific changes to the state of a server instance. The following sections describe WebLogic Server states, the state transitions that can occur, and the relationship between commands that you issue and server state transitions.

 


Lifecycle Overview

The series of states through which a WebLogic Server instance can transition is called the server lifecycle. Figure 6-1 illustrates the server lifecycle and the relationships between WebLogic Server operating states.

Figure 6-1 The Server Lifecycle


 


 

To understand the each state, and the relationships among states, see WebLogic Server States.

 


WebLogic Server States

WebLogic Server displays and stores information about the current state of a server instance, and state transitions that have occurred since the server instance started up. This information is useful to administrators who:

Getting Server State

There are multiple methods of accessing the state of a server instance:

Understanding Server State

The following sections describe the key states that a server instance can have, the processing associated with the state, and how the state fits into a sequence of state transitions.

SHUTDOWN

In the SHUTDOWN state, a server instance is configured but inactive. A server instance reaches the SHUTDOWN state as a result of a graceful shutdown or forced shutdown.

A graceful shutdown can be initiated when the server instance is in the RUNNING or the STANDBY state. The graceful shutdown process consists of the following state transitions:

RUNNING—>SUSPENDING—>STANDBY—>SHUTTING DOWN—>SHUTDOWN

For more information about the graceful shutdown process, see Graceful Shutdown.

A forced shutdown can be initiated from any server state. The forced shutdown process consists of the following state transitions:

any state—>STANDBY—>SHUTTING DOWN—>SHUTDOWN

For more information about the forced shutdown process, see Forced Shutdown.

For information about issuing stop commands, see "Starting and Stopping Servers" in Administration Console Online Help.

STARTING

In the STARTING state, a server instance prepares itself to accept requests and perform application processing. A server instance cannot accept requests while in the STARTING state.

When a server instance starts itself, it retrieves its configuration data, starts its kernel-level services, initializes subsystem-level services, deploys applications, and loads and runs startup classes. For more information about the startup process, see Start.

A server instance can enter the STARTING state only from the SHUTDOWN state, as a result of either a Start command or a Start in Standby command.

SHUTDOWN—>STARTING—>RUNNING

SHUTDOWN—>STARTING—>STANDBY

For information about issuing start commands, see "Starting and Stopping Servers" in Administration Console Online Help.

STANDBY

In the STANDBY state, a server has initialized all of its services and applications, can accept administration commands, and can participate in cluster communication. However, it does not accept requests from external clients.

The server instance can enter the STANDBY if:

RESUMING

A server instance enters the RESUMING state as a result of the Resume this server... command. A server instance that is resumed from the STANDBY goes through the following state transitions:

STANDBY—>RESUMING—>RUNNING

RUNNING

When a server instance is in the RUNNING state, it offers its services to clients and can operate as a full member of a cluster. A server instance can enter the STANDBY if:

SUSPENDING

A server instance enters this state during the graceful shutdown process. While in the SUSPENDING state, the server handles in-flight work. The processing a server instance perform for in-flight work while in the SUSPENDING state is described in In-Flight Work Processing. Upon completion of in-flight work, the server progresses from the SUSPENDING state to the SHUTTING_DOWN state.

During the graceful shutdown process, a server instance goes through the following state transitions:

RUNNING—>SUSPENDING—>STANDBY—>SHUTTING DOWN—>SHUTDOWN

SHUTDOWN

A server instance enters the shutdown state as a result of a graceful shutdown or forced shutdown process.

During the graceful shutdown process, a server instance goes through the following state transitions:

RUNNING—>SUSPENDING—>STANDBY—>SHUTTING DOWN—>SHUTDOWN

For more information about the graceful shutdown process, see Graceful Shutdown.

During the forced shutdown process, a server instance goes through the following state transitions:

any state—>STANDBY—>SHUTDOWN

For more information about the forced shutdown process, see Forced Shutdown.

FAILED

A server instance enters the FAILED state when one or more critical services become dysfunctional. When a server instance finds one or more critical subsystems have failed, the server instance sets its state to FAILED to indicate that the it cannot reliably host an application.

To recover from the FAILED state, a server instance must be shutdown and restarted, either manually, or automatically with Node Manager, if it is configured on the host machine. For information about automatic restarts, see Shutdown Failed Managed Servers.

A server instance can only enter the FAILED state from the RUNNING state:

RUNNING—>FAILED

UNKNOWN

If a server instance cannot be contacted, it is considered to be in the UNKNOWN state.

States Defined by Node Manager

When Node Manager restarts a failed or killed Managed Server, it defines additional server states, which are described in Node Manager and Managed Server States. These states are displayed in the Administration Console, and provide visibility into the status of the restart process.

For information about Node Manager, see Overview of Node Manager.

 


Lifecycle Commands

This section describes key commands that affect the state of a server instance, and the processing a server instance performs as a result of the command. For information about issuing lifecycle commands, see "Starting and Stopping Servers" in Administration Console Online Help.

Start

When a server instance starts, it:

  1. Retrieves its configuration data.

    An Administration Server retrieves domain configuration data, including security configuration data, from the config.xml for the domain.

    A Managed Server contacts the Administration Server for its configuration and security data. If you set up SSL, a Managed Server uses its own set of certificate files, key files, and other SSL-related files and contacts the Administration Server for the remaining configuration and security data.

  2. Starts its kernel-level services, which include logging and timer services.

    Initializes subsystem-level services with the configuration data that it retrieved in step 2a. These services include the following:

    • Security Service

    • RMI Service

    • Cluster Service

    • IIOP Service

    • Naming Service

    • RMI Naming Service

    • File Service

    • JCA Container

    • JDBC Container

    • EJB Container

    • Web Container

    • Deployment Manager

    • JMS Provider

    • Remote Management

    • Transaction Service

  3. If you have configured a server instance to use a separate administration port, the server enables remote configuration and monitoring. For information about administration ports, see Administration Port Requires SSL.
  4. Deploys modules in the appropriate container and in the order that you specify in the WebLogic Server Administration Console.

    Startup classes that are configured to load before application deployments are loaded and run after the server instance deploys JDBC connection pools and before it deploys Web applications and EJBs.

  5. Startup classes that are configured to load after application deployments are loaded and run.

Graceful Shutdown

A graceful shutdown gives WebLogic Server subsystems time to complete certain application processing currently in progress. The work completed is referred to as in-flight work. During a graceful shutdown, subsystems complete in-flight work and suspend themselves in an specific sequence and in a synchronized fashion, so that back-end subsystems like JDBC connection pools are available when front-end subsystems are suspending themselves.

Graceful Shutdown Sequence

The following list shows the order in which subsystems suspend themselves. Each subsystem completes its in-flight work before the next one commences its preparation to suspend.

  1. Non-Transaction RMI Service
  2. Web Container
  3. Client Initiated Transaction Service
  4. Remote RMI Service
  5. Timer Service
  6. Application Service
  7. EJB Container
  8. JMS Provider
  9. JDBC Container
  10. Transaction Service

Controlling Graceful Shutdown

ServerMBean has two new attributes for controlling the length of the graceful shutdown process. Their values are displayed and configurable on the Server—>Control—>Start/Stop tab:

Note: Graceful Shutdown Timeout is a different attribute from ServerLifeCycleTimeoutVal, which applies only to a force shutdown.

In-Flight Work Processing

The following sections describe how each subsystem handles work in process when it suspends itself during a graceful shutdown.

RMI Subsystem

The RMI subsystem suspends in three steps. Each step in this process completes before the following step commences.

  1. Non-transaction remote requests are rejected by the Non-Transaction RMI Service.
  2. The Client Initiated Transaction Service waits for pending client transactions to complete.
  3. The Remote RMI Service rejects all remote requests with or without transactions.

After these steps are completed, no remote client requests are allowed. Requests with administrative privileges and internal system calls are accepted.

When a clustered server instance is instructed to prepare to suspend, the RMI system refuses any in-memory replication calls, to allow other cluster members to choose new secondaries.

Web Container

After the Web Container subsystem is instructed to prepare to suspend, it rejects new sessions requests. Existing sessions are handled according to the persistence method:

The completion of pending sessions is optional. To immediate drop all sessions, use the Ignore Sessions During Shutdown option on the Servers—>Control—> Start/Stop tab in the Administration Console, or the -ignoreSessions option with weblogic.Admin.

Timer Service

The Timer Service cancels all triggers running on application execute queues. Application execute queues include the default queue and queues configured through the ExecuteQueueMBean.

Application Service

The Application Service completes pending work in the application queues before suspending. Application execute queues include the default queue and queues configured through the ExecuteQueueMBean.

EJB Container

The EJB Container suspends MDBs.

JMS Service

The JMS Service marks itself as suspending and waits for its reference count of pending requests to drop to zero.

JDBC Service

The JDBC Service closes idle connections in the connection pools.

Transaction Service

The Transaction Service waits for the pending transaction count in the Transaction Manager to drop to zero before suspending. Completing all pending transactions can be a lengthy process, depending on the configuredbtransaction timeout.

If a graceful shutdown takes too long because of pending transactions, you can halt it with a forced shutdown command. A forced shutdown suspends all pending work in all subsystems.

Forced Shutdown

A forced shutdown is immediate—WebLogic Server subsystems suspend all application processing currently in progress. A forced shutdown can be performed on a server instance in any state.

ServerMBean defines the ServerLifecycleTimeoutVal attribute, which specifies a timeout period for subsystems to suspend themselves. If a subsystem fails to suspend itself within the timeout period, the server instance is killed.

 

Back to Top Previous Next