This document describes the BEA WebLogic Scripting Tool (WLST). It explains how you use the WLST command-line scripting interface to configure, manage, and persist changes to WebLogic Server® instances and domains, and monitor and manage server runtime events.
This document is written for WebLogic Server administrators and operators who deploy Java EE applications using the Java Platform, Enterprise Edition (Java EE) from Sun Microsystems. It is assumed that readers are familiar with Web technologies and the operating system and platform where WebLogic Server is installed.
Guide to This Document
This document is organized as follows:
This chapter, Introduction and Roadmap, introduces the organization of this guide and lists related documentation.
Creating Domains Using WLST Offline, describes how to create a new domain or update an existing domain without connecting to a running WebLogic Server (that is, using WLST offline)—supporting the same functionality as the Configuration Wizard.
Managing the Server Life Cycle, describes using WLST to start and stop WebLogic Server instances and to monitor and manage the server life cycle.
Navigating MBeans (WLST Online), describes how to retrieve domain configuration and runtime information, and edit configuration or custom MBeans.
Configuring Existing Domains, describes using scripts to automate the creation and management of domains, servers, and resources.
Getting Runtime Information, describes using WLST to retrieve information about the runtime state of WebLogic Server instances.
WLST Deployment Objects, describes WLST deployment objects that you can use to update a deployment plan or access information about the current deployment activity.
FAQs: WLST, provides a list of common questions and answers.
Related Documentation
WLST is one of several interfaces for managing and monitoring WebLogic Server. For information about the other management interfaces, see:
“Overview of Deployment Tools” in Deploying Applications to WebLogic Server, describes several tools that WebLogic Server provides for deploying applications and stand-alone modules.
WebLogic SNMP Management Guide, describes using Simple Network Management Protocol (SNMP) to monitor WebLogic Server domains.
WLST Sample Scripts
The following sections describe the WLST online and offline sample scripts that you can run or use as templates for creating additional scripts. For information about running scripts, see Invoking WLST.
WLST Online Sample Scripts
The WLST online sample scripts demonstrate how to perform administrative tasks and initiate WebLogic Server configuration changes while connected to a running server. WLST online scripts are located in the following directory: SAMPLES_HOME\server\examples\src\examples\wlst\online, where SAMPLES_HOME refers to the main examples directory of your WebLogic Server installation, such as c:\beahome\wlserver_10.0\samples.
Connects WLST to an Administration Server, starts an edit session, and creates 10 Managed Servers. It then creates two clusters, assigns servers to each cluster, and disconnects WLST from the server.
cluster_deletion.py
Removes the clusters and servers created in cluster_creation.py.
configJMSSystemResource.py
Connects WLST to an Administration Server, starts an edit session, creates two JMS Servers, and targets them to the Administration Server. Then creates JMS topics, JMS queues, and JMS templates in a JMS System module. The JMS queues and topics are targeted using sub-deployments.
deleteJMSSystemResource.py
Removes the JMS System module created by configJMSSystemResource.py.
jdbc_data_source_creation.py
Connects WLST to an Administration Server, starts an edit session, and creates a JDBC data source called myJDBCDataSource.
jdbc_data_source_deletion.py
Removes the JDBC data source created by jdbc_data_source_creation.py.
WLST Offline Sample Scripts
The WLST offline sample scripts demonstrate how to create domains using the domain templates that are installed with the software. The WLST offline scripts are located in the following directory: WL_HOME\common\templates\scripts\wlst, where WL_HOME refers to the top-level installation directory for WebLogic Server.
Creates a simple WebLogic domain demonstrating how to open a domain template, create and edit configuration objects, and write the domain configuration information to the specified directory.
The sample consists of a single server, representing a typical development environment. This type of configuration is not recommended for production environments.
The script uses the Basic WebLogic Server Domain template.
clusterMedRecDomain.py
Creates a single-cluster domain, creating three Managed Servers and assigning them to a cluster.
The script uses the Basic WebLogic Server Domain template and extends it using the Avitek Medical Records Sample extension template.
distributedQueues.py
Demonstrates two methods for creating distributed queues.
The script uses the Basic WebLogic Server Domain template and extends it using the Avitek Medical Records Sample.
sampleMedRecDomain.py
Creates a domain that defines resources similar to those used in the Avitek MedRec sample. This example does not recreate the MedRec example in its entirety, nor does it deploy any sample applications.
The script uses the Basic WebLogic Server Domain template.
In addition, BEA provides sample scripts to configure WebLogic domain resources using WLST offline and online on the dev2dev Web site. For more information, see the wlst Project Homeat https://wlst.projects.dev2dev.bea.com.
New and Changed WLST Features in This Release
WebLogic Server release 10.0 introduces only minor changes to WLST:
In the storeUserConfig command, userConfigFile and userKeyFile are now optional arguments. If you do not specify these arguments, WLST stores the configuration and key files in a default location. See storeUserConfig.
You can now use the migrate command to migrate only JMS-related services. See migrate.
The connect command adds the timeout argument to specify the number of milliseconds that WLST online commands wait to complete.
When you invoke a WLST online command, WLST connects to an MBean server, invokes an MBean server method, and returns the results of the invocation. By default, WLST will wait up to 5 minutes for the command to return the results of the invocation. If the MBean server method does not complete (return) within the timeout period, WLST abadons its invocation attempt and notifies you. You can now change this default timeout. See connect.
You can now record your configuration actions in the Administration Console as a series of WebLogic Scripting Tool (WLST) commands and then use WLST to run the commands. For more information, see “Record WLST Scripts” in WebLogic Server Administration Console Help.
The wlst Ant task now supports a classpath nested element that you can use if your script requires classes that are not already on the classpath. This element is the standard Ant classpath element. See Running WLST from Ant.