Configuring and Managing WebLogic Server
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
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, state transitions, life cycle commands.
The series of states through which a WebLogic Server instance can transition is called the server life cycle. Figure 7-1 illustrates the server life cycle and the relationships between WebLogic Server operating states.
Figure 7-1 The Server Life Cycle
To understand each state, and the relationships among states, see Understanding 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:
There are multiple methods of accessing the state of a server instance:
getState()
method on the server's weblogic.management.runtime.
ServerRuntimeMBean
. For example, to monitor the progress of a long-running graceful shut down process, issue a getstate
inquiry on a separate thread. For more information see Accessing Runtime Information in Programming WebLogic Management Services with JMX. 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.
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
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
See Forced Shutdown.
See Starting and Stopping Servers in Administration Console Online Help.
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 a Start command.
See Starting and Stopping Servers in Administration Console Online Help.
In the STANDBY
state, a server has initialized all of its services and internal applications (such as the Administration Console), can accept administration commands, and can participate in cluster communication. Non-internal applications are partially deployed; when you move the server to the RUNNING
state it completes the remainder of the deployment process. A server in the STANDBY
state does not accept requests from external clients.
A server instance enters STANDBY
when:
Starting a server instance in standby is a method of keeping it available as a "hot" backup, especially in a high-availability environment. A server instance started in standby can be quickly brought to the running state to replace a failed server instance.
A server instance started in standby mode goes through the following state transitions:
STANDBY
state during any shutdown process. During the graceful shutdown process, a server instance goes through the following state transitions:
RUNNING
SUSPENDING
STANDBY
SHUTTING DOWN
SHUTDOWN
During the forceful shutdown process, a server instance goes through the following state transitions:
A server instance enters the RESUMING
state as a result of the Resume command. A server instance that is resumed from the STANDBY
goes through the following state transitions:
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 RUNNING
state if:
A server instance enters this state during the graceful shutdown process. While in the SUSPENDING
state, the server handles a predefined portion of the work that is currently in process—referred to as "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
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
See Graceful Shutdown.
During the forced shutdown process, a server instance goes through the following state transitions:
See Forced Shutdown.
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 Shut Down Failed Managed Servers.
A server instance can only enter the FAILED
state from the RUNNING
state:
If a server instance cannot be contacted, it is in the UNKNOWN
state.
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.
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 life cycle commands, see Starting and Stopping Servers in Administration Console Online Help.
For information about Node Manager processing related to key lifecycle events in environments that use Node Manager, see Node Manager Communications for Lifecycle Operations.
When a server instance starts, it:
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.
Initializes subsystem-level services with the configuration data that it retrieved in step 1. These services include the following:
A graceful shutdown gives WebLogic Server subsystems time to complete certain application processing currently in progress. The work that it completes during graceful shutdown is referred to as in-flight work. During a graceful shutdown, subsystems complete in-flight work and suspend themselves in a 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.
Note: The graceful shutdown process synchronizes shutdown operations and in-flight work for WebLogic execute queue threads. Applications that create threads must control the in-flight processing for pending work in application threads; this can be accomplished in a shutdown class.
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.
ServerMBean
has two new attributes for controlling the length of the graceful shutdown process. Their values are displayed and configurable on the Server
The following sections describe how each subsystem handles work in process when it suspends itself during a graceful shutdown.
The Remote Method Invocation (RMI) subsystem suspends in three steps. Each step in this process completes before the following step commences.
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 hosts for replicated sessions.
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 drop all sessions immediately, use the Ignore Sessions During Shutdown option on the Servers-ignoreSessions
option with weblogic.Admin
.
The Timer Service cancels all triggers running on application execute queues. Application execute queues include the default queue and queues configured through the ExecuteQueueMBean
.
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
.
The EJB Container suspends Message Drive Beans (MDBs.)
The Java Messaging Service (JMS) marks itself as suspending, which causes new requests to be rejected. The JMS system suspends gracefully in this fashion:
If the server instance being shutdown has a JMS server:
If the server instance being shutdown has a JMS connection factory:
Generally each step in the graceful suspend of the JMS subsystem occurs quickly—in less than a second. Potentially, completion of a client request could take longer, if the request requires higher than normal disk I/O, for example, a request for a persistent "send" of a 100-megabyte message.
You can monitor the number of connections to a JMS server, the number of consumers to a JMS connection factory, and related run-time information using JMS run-time Mbeans, including JMSRuntimeMbean, JMSConnectionRuntimeMBean, JMSConsumerRuntimeMBean.
The JDBC Service closes idle connections in the connection pools.
Note: If connections are still in use, the shutdown of the JDBC service will fail, and the graceful shutdown will not complete. To shut down a server instance while applications still hold connections, use a forced shutdown command, described in Forced Shutdown.
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 configured transaction 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.
During both graceful and forced shutdown, subsystems undeploy applications as appropriate. This processing can result in invocation of application code, such as servlet destroy()
or ejbRemove()
during shutdown. During the shutdown sequence, JMS, JDBC, and transactions are shutdown after applications are shutdown, allowing application code to access JMS, JDBC, and transaction services.
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.
If a fatal exception causes the forced shutdown to fail, the server will exit after the number of seconds specified by the ServerLifecycleTimeoutVal
attribute in ServerMBean
.
For information about undeployment processes during a forced shutdown, and related programming considerations, see Shutdown Operations and Application Undeployment.
![]() ![]() |
![]() |
![]() |