Config Scripting
Config Scripting
Config Scripting
Server ®
Version 9.0
Revised: July 22, 2005
Copyright
Copyright © 2005 BEA Systems, Inc. All Rights Reserved.
FAQs: WLST
This section describes the contents and organization of this guide—WebLogic Scripting Tool.
z This chapter, “Introduction and Roadmap,” introduces the organization of this guide and
lists related documentation.
z Chapter 2, “Using the WebLogic Scripting Tool,” describes how the scripting tool works,
its modes of operation, and the basic steps for invoking it.
z Chapter 5, “Managing Servers and Server Life Cycle,” describes using WLST to start and
stop WebLogic Server instances and to monitor and manage the server life cycle.
z Appendix C, “WLST Deployment Objects,” describes WLST deployment objects that you
can use to update a deployment plan or access information about the current deployment
activity.
Related Documentation
z “Using Ant Tasks to Configure and Use a WebLogic Server Domain” in Developing
Applications With WebLogic Server
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.
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.
This example demonstrates steps similar to those shown in the WLST online
script described in “Creating a Sample Domain: Main Steps” on page 6-2, but
uses WLST offline.
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 Home at
https://wlst.projects.dev2dev.bea.com.
z Retrieve domain configuration and runtime information. See “Navigating and Interrogating
MBeans” on page 4-1.
z Edit the domain configuration and persist the changes in the domain’s configuration files.
See “Editing Configuration MBeans” on page 4-12.
z Edit custom, user-created MBeans and non-WebLogic Server MBeans, such as WebLogic
Integration Server and WebLogic Portal Server MBeans. See “Accessing Custom MBeans”
on page 4-11.
z Control and manage the server life cycle. See “Managing Servers and Server Life Cycle”
on page 5-1.
z Access the Node Manager and start, stop, and suspend server instances remotely or locally,
without requiring the presence of a running Administration Server. See “Using WLST and
Node Manager to Manage Servers” on page 5-4.
WLST functionality includes the capabilities of these WebLogic Server command-line utilities:
the weblogic.Admin utility that you use to interrogate MBeans and configure a WebLogic
Server instance (deprecated in this release of WebLogic Server), the wlconfig Ant task tool for
making WebLogic Server configuration changes, and the weblogic.Deployer utility for
deploying applications. For more information about these command-line utilities, see:
z “Using Ant Tasks to Configure and Use a WebLogic Server Domain” in Developing
Applications with WebLogic Server, describes using WebLogic Ant tasks for starting and
stopping WebLogic Server instances and configuring WebLogic Server domains.
prefer using a graphical or command-line interface, and whether you can automate your tasks by
using a script. See “Script Mode” on page 2-4.
Note: Because WLST offline enables you to access and update the configuration objects that
appear in the configuration files only, if you wish to view and/or change attribute values
for a configuration object that is not already persisted in the configuration files as an
XML element, you must first create the configuration object.
Modes of Operation
WLST is a command-line interpreter that interprets commands either interactively, supplied
one-at-a-time from a command prompt, or in batches, supplied in a file (script), or embedded in
your Java code. The modes of operation represent methods for issuing WLST commands:
Interactive Mode
Interactive mode, in which you enter a command and view the response at a command-line
prompt, is useful for learning the tool, prototyping command syntax, and verifying configuration
options before building a script. Using WLST interactively is particularly useful for getting
immediate feedback after making a critical configuration change. The WLST scripting shell
maintains a persistent connection with an instance of WebLogic Server. Because a persistent
connection is maintained throughout the user session, you can capture multiple steps that are
performed against the server. See “Recording User Interactions” on page 2-13.
In addition, each command that you enter for a WebLogic Server instance uses the same
connection that has already been established, eliminating the need for user re-authentication and
a separate JVM to execute the command.
Script Mode
Scripts invoke a sequence of WLST commands without requiring your input, much like a shell
script. Scripts contain WLST commands in a text file with a .py file extension, for example,
filename.py. You use script files with the Jython commands for running scripts. See “Running
Scripts” on page 2-10.
Using WLST scripts, you can:
z Apply the same configuration settings, iteratively, across multiple nodes of a topology
z Take advantage of scripting language features, such as loops, flow control constructs,
conditional statements, and variable evaluations that are limited in interactive mode
connect('username','password','t3://localhost:7001')
clusters = "cluster1","cluster2"
ms1 = {'managed1':7701,'managed2':7702,'managed3':7703, 'managed4':7704,
'managed5':7705}
ms2 = {'managed6':7706,'managed7':7707,'managed8':7708, 'managed9':7709,
'managed10':7710}
clustHM = HashMap()
edit()
startEdit()
for c in clusters:
print 'creating cluster '+c
clu = create(c,'Cluster')
clustHM.put(c,clu)
cd('..\..')
clus1 = clustHM.get(clusters[0])
clus2 = clustHM.get(clusters[1])
for m, lp in ms1.items():
managedServer = create(m,'Server')
print 'creating managed server '+m
managedServer.setListenPort(lp)
managedServer.setCluster(clus1)
Embedded Mode
In embedded mode, you instantiate an instance of the WLST interpreter in your Java code and
use it to run WLST commands and scripts. All WLST commands and variables that you use in
interactive and script mode can be run in embedded mode.
Listing 2-2 illustrates how to instantiate an instance of the WLST interpreter and use it to connect
to a running server, create two servers, and assign them to clusters.
package wlst;
import java.util.*;
import weblogic.management.scripting.utils.WLSTInterpreter;
import org.python.util.InteractiveInterpreter;
/**
* Simple embedded WLST example that will connect WLST to a running server,
* create two servers, and assign them to a newly created cluster and exit.
* <p>Title: EmbeddedWLST.java</p>
* <p>Copyright: Copyright (c) 2004</p>
* <p>Company: BEA Systems</p>
* @author Satya Ghattu ([email protected])
*/
EmbeddedWLST() {
interpreter = new WLSTInterpreter();
}
1. Install and configure the WebLogic Server software, as described in the WebLogic Server
Installation Guide.
Invoking WLST
Note: When invoking WLST from an Ant script, it is recommended that you fork a new JVM
by specifying fork="true". This will ensure a clean environment and prevent the
WLST exit command, which calls System.exit(0), from exiting the Ant script.
To invoke WLST:
1. If you will be connecting to a WebLogic Server instance through an SSL listen port on a server
that is using the demonstration SSL keys and certificates, invoke WLST using the following
command:
java -Dweblogic.security.SSL.ignoreHostnameVerification=true
-Dweblogic.security.TrustKeyStore=DemoTrust weblogic.WLST
2. To use WLST offline, enter commands, set variables, or run a script at the WLST prompt.
For more information, see “Creating and Configuring WebLogic Domains Using WLST
Offline” on page 3-1.
To use WLST online, start a WebLogic Server instance (see Starting and Stopping Servers)
and connect WLST to the server using the connect command.
wls:/(offline)> connect('username','password','t3s://localhost:7002')
Connecting to weblogic server instance running at t3s://localhost:7002
as username weblogic ...
Successfully connected to Admin Server 'myserver' that belongs to
domain 'mydomain'.
wls:/mydomain/serverConfig>
Note: BEA Systems strongly recommends that you connect WLST to the server through an
SSL port or the administration port. If you do not, the following warning message is
displayed:
Warning: An insecure protocol was used to connect to the server.
To ensure on-the-wire security, the SSL port or Admin port should be
used instead.
For detailed information about the connect command, see “connect” on page A-10.
z If you specify a backslash character (\) in a string, for example when specifying a file
pathname, you should precede the quoted string by r to instruct WLST to interpret the
string in its raw form and ensure that the backslash is taken literally. This format represents
standard Jython syntax. For example:
readTemplate(r'c:\mytemplate.jar')
z When using WLST offline, the following characters are not valid in object names: period
(.), forward slash (/), or backward slash (\).
If you need to cd to an object name that includes a forward slash (/) in its name, include
the configuration object name in parentheses. For example:
cd('JMSQueue/(jms/REGISTRATION_MDB_QUEUE)')
z Using WLST and a domain template, you can only create and access security information
when you are creating a new domain. When you are updating a domain, you cannot access
security information through WLST.
z Display help information for WLST commands by entering the help command. See
“Getting Help” on page 2-12.
Running Scripts
WLST incorporates two Jython functions that support running scripts: java weblogic.WLST
filePath.py, which invokes WLST and executes a script file in a single command, and
execfile(filePath.py) which executes a script file after you invoke WLST.
To run the script examples in this guide, copy and save the commands in a text file with a .py file
extension, for example, filename.py. Use the text file with the commands for running scripts
that are listed below. There are sample scripts that you can use as a template when creating a
script.py file from scratch. For more information, see “WLST Sample Scripts” on page 1-3.
If the script will connect WLST to a running server instance, start WebLogic Server before
running the script.
For example:
c:\>java weblogic.WLST
Initializing WebLogic Scripting Tool (WLST) ...
...
...
wls:/(offline)>execfile('c:/temp/example.py')
starting the script ...
...
1. Invoke WLST.
c:\>java weblogic.WLST
wls:/(offline)>
2. Use the writeIniFile command to convert WLST definitions and method declarations to
a .py file.
wls:/(offline)> writeIniFile("wl.py")
The Ini file is successfully written to wl.py
wls:/(offline)>
3. Open a new command shell and invoke Jython directly by entering the following command:
c:\>java org.python.util.jython
The Jython package manager processes the JAR files in your classpath. The Jython prompt
appears:
>>>
4. Import the WLST module into your Jython module using the Jython import command.
>>>import wl
5. Now you can use WLST methods in the module. For example, to connect WLST to a server
instance:
wl.connect('username','password')
....
Note: When using WLST as a Jython module, in all WLST commands that have a block
argument, block is always set to true, specifying that WLST will block user
interaction until the command completes. See “WLST Command and Variable
Reference” on page A-1.
Exiting WLST
To exit WLST:
wls:/mydomain/serverConfig> exit()
Exiting WebLogic Scripting Tool ...
c:\>
Getting Help
To display information about WLST commands and variables, enter the help command.
If you specify the help command without arguments, WLST summarizes the command
categories. To display information about a particular command, variable, or command category,
specify its name as an argument to the help command. To list a summary of all online or offline
commands from the command line using the following commands, respectively:
help('online')
help('offline')
The help command will support a query; for example, help('get*') displays the syntax and
usage information for all commands that begin with get.
For example, to display information about the disconnect command, enter the following
command:
wls:/mydomain/serverConfig> help('disconnect')
The command returns the following:
Description:
Disconnect from a weblogic server instance.
Syntax:
disconnect()
Example:
wls:/mydomain/serverConfig> disconnect()
For more information, see “startRecording” on page A-84 and “stopRecording” on page A-86.
For more information, see “redirect” on page A-82 and “stopRedirect” on page A-86.
z The domain directory that contains the configuration that you want to convert (defaults to
./config)
z The path to the directory in which you want to write the converted WLST script (defaults
to ./config/config.py)
z The path to the directory in which you want to store the properties file (defaults to
pathname specified for scriptPath)
z If a server is currently running, WLST will try to connect using the values in the properties
file and then run the script commands to create the server resources.
z If no server is currently running, WLST will start a server with the values in the properties
file, run the script commands to create the server resources, and shutdown the server. This
may cause WLST to exit from the command shell.
For example, the following command creates a WLST script from the domain located at
c:/bea/user_projects/domains/mydomain, and saves it to c:/bea/myscripts.
wls:/(offline)> configToScript('c:/bea/user_projects/domains/mydomain',
'c:/bea/myscripts')
For more information, see “configToScript” on page A-69.
Customizing WLST
You can customize WLST using the WLST home directory, which is located at
WL_HOME/common/wlst, by default, where WL_HOME refers to the top-level installation directory
for WebLogic Server. All Python scripts that are defined within the WLST home directory are
imported at WLST startup.
Note: You can customize the default WLST home directory by passing the following argument
on the command line:
-Dweblogic.wlstHome=< >
The following table describes ways to customize WLST.
WLST enables you 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.
You can create new configuration information, and retrieve and change existing configuration
information that is persisted in the domain configuration files (located in the config directory,
for example, config.xml) or in a domain template JAR created using Template Builder.
The following sections describe how to create and configure WebLogic domains using WLST
offline. Topics include:
z “Stepping Through a Sample Script: Creating a Domain Using WLST Offline” on page 3-8
For more information about the Configuration Wizard, see Creating WebLogic Domains Using
the Configuration Wizard.
Notes: Before creating or updating a domain, you must set up your environment and invoke
WLST, as described in “Main Steps for Using WLST” on page 2-8. You can exit WLST
at anytime using the exit command, as follows: exit()
When using the Configuration Wizard or WLST Offline to create or extend a clustered
domain with a template that has applications containing application-scoped JDBC and/or
JMS resources, you may need to perform additional steps (after the domain is created or
extended) to make sure that the application and its application-scoped resources are
targeted and deployed properly in a clustered environment. For more information on the
targeting and deployment of application-scoped modules, see "Deploying Applications
and Modules" in Deploying Applications to WebLogic Server at
http://e-docs.bea.com/wls/docs90/deployment/deploy.html.
List child attributes or configuration beans for ls(['a' | 'c']) “ls” on page A-78
the current configuration bean
Toggle the display of the configuration bean prompt(['off'|'on']) “prompt” on page A-5
navigation path information at the prompt
Display the stack trace from the last exception dumpStack() “dumpStack” on page A-71
that occurred while performing a WLST action
z Examples of creating specific types of MBean resources, for example, a JMS or JDBC
system resource, refer to the WLST sample scripts installed with your product, as
described in “WLST Sample Scripts” on page 1-3.
z MBeans, their child types, attributes, and operations, see WebLogic Server MBean
Reference at http://e-docs.bea.com/wls/docs90/wlsmbeanref/core/index.html.
create('AdminServer','SSL')
cd('SSL/AdminServer')
set('Enabled', 'True')
set('ListenPort', 7002)
f. Create a JDBC data source, configure the JDBC driver, and create a new JDBC user.
cd('/')
create('myDataSource', 'JDBCSystemResource')
cd('JDBCSystemResource/myDataSource/JdbcResource/myDataSource')
create('myJdbcDriverParams','JDBCDriverParams')
cd('JDBCDriverParams/NO_NAME_0')
set('DriverName','com.pointbase.jdbc.jdbcUniversalDriver')
set('URL','jdbc:pointbase:server://localhost/demo')
set('PasswordEncrypted', 'PBPUBLIC')
set('UseXADataSourceInterface', 'false')
create('myProps','Properties')
cd('Properties/NO_NAME_0')
create('user', 'Property')
cd('Property/user')
cmo.setValue('PBPUBLIC')
cd('/JDBCSystemResource/myDataSource/JdbcResource/myDataSource')
create('myJdbcDataSourceParams','JDBCDataSourceParams')
cd('JDBCDataSourceParams/NO_NAME_0')
set('JNDIName', java.lang.String("myDataSource_jndi"))
cd('/JDBCSystemResource/myDataSource/JdbcResource/myDataSource')
create('myJdbcConnectionPoolParams','JDBCConnectionPoolParams')
cd('JDBCConnectionPoolParams/NO_NAME_0')
set('TestTableName','SYSTABLES')
5. Exit WLST.
exit()
The following sections describe how to navigate, interrogate, and edit MBeans using WLST:
WebLogic Server organizes its MBeans in a hierarchical data model. In the WLST file system,
MBean hierarchies correspond to drives; MBean types and instances are directories; MBean
attributes and operations are files. WLST traverses the hierarchical structure of MBeans using
commands such as cd, ls, and pwd in a similar way that you would navigate a file system in a
UNIX or Windows command shell. After navigating to an MBean instance, you interact with the
MBean using WLST commands.
Note: Because WLST offline enables you to access and update the configuration objects that
appear in the configuration files only, if you wish to view and/or change attribute values
for a configuration object that is not already persisted in the configuration files as an
XML element, you must first create the configuration object.
In the configuration hierarchy, the root directory is DomainMBean (see DomainMBean in the
WebLogic Server MBean Reference); the MBean type is a subdirectory under the root directory;
the name of the MBean (the MBean instance) is a subdirectory under the MBean type directory;
and MBean attributes and operations are nodes (like files) under the MBean directory. Each
MBean instance is a subdirectory of an MBean type. In most cases, there can be multiple
instances of a type.
WLST first connects to a WebLogic Server instance at the root of the server’s configuration
MBeans, a single hierarchy whose root is DomainMBean. WLST commands provide access to all
the WebLogic Server MBean hierarchies within a domain, such as a server’s runtime MBeans,
runtime MBeans for domain-wide services, and an editable copy of all the configuration MBeans
in the domain. For more information, see “Tree Commands” on page A-112.
For more information about MBean hierarchies, see “WebLogic Server MBean Data Model” in
Developing Custom Management Utilities with JMX.
After navigating to an instance of ServerMBean, WLST changes the value of cmo from
DomainMBean to ServerMBean.
-r-- AdministrationPort 0
-r-- AdministrationPortAfterOverride 9002
-r-- AdministrationPortEnabled false
-r-- AdministrationProtocol t3s
-r-- AutoKillIfFailed false
-r-- AutoRestart true
....
wls:/mydomain/serverConfig/Servers/myserver> cd('Log/myserver')
wls:/mydomain/serverConfig/Servers/myserver/Log/myserver> ls()
dr-- DomainLogBroadcastFilter
dr-- LogFileFilter
dr-- MemoryBufferFilter
dr-- StdoutFilter
In the ls command output information, d designates an MBean with which you can use the cd
command (analogous to a directory in a file system), r indicates a readable property, w indicates
a writeable property, and x an executable operation.
Note: The ls command property information is based on MBeanInfo; it does not reflect user
permissions.
To navigate back to a parent MBean, enter the cd(’..’) command:
wls:/mydomain/serverConfig/Servers/myserver/Log/myserver> cmo
[MBeanServerInvocationHandler]mydomain:Name=myserver,Server=myserver,Type=
Log
wls:/mydomain/serverConfig/Servers/myserver/Log/myserver> cd('..')
wls:/mydomain/serverConfig/Servers/myserver/Log>
wls:/mydomain/serverConfig/Servers/myserver/Log> cmo
[MBeanServerInvocationHandler]mydomain:Name=myserver,Type=Server
After navigating back to the parent MBean type, WLST changes the cmo from LogMBean to
ServerMBean.
To get back to the root MBean after navigating to an MBean that is deep in the hierarchy, enter
the cd('/') command.
dr-- DeployerRuntime
...
dr-- ServerLifecycleRuntimes
dr-- ServerRuntimes
: java.lang.String
wls:/mydomain/domainRuntime>
The commands in Listing 4-4 instruct WLST to navigate and display runtime MBeans on a
Managed Server instance.
wls:/offline> connect('username','password',‘t3://localhost:7701’)
Connecting to weblogic server instance running at t3://localhost:7701 as
username weblogic ...
Successfully connected to managed Server 'managed1' that belongs to domain
'mydomain'.
Warning: An insecure protocol was used to connect to the server.
To ensure on-the-wire security, the SSL port or Admin port should be used
instead.
wls:/mydomain/serverConfig> serverRuntime()
wls:/mydomain/serverRuntime> ls()
dr-- ApplicationRuntimes
dr-- ClusterRuntime
...
dr-- JMSRuntime
dr-- JTARuntime
dr-- JVMRuntime
dr-- LibraryRuntimes
dr-- MailSessionRuntimes
dr-- RequestClassRuntimes
dr-- ServerChannelRuntimes
dr-- ServerSecurityRuntime
dr-- ThreadPoolRuntime
dr-- WLDFAccessRuntime
dr-- WLDFRuntime
dr-- WTCRuntime
dr-- WorkManagerRuntimes
The commands in the following example instruct WLST to navigate from the runtime MBean
hierarchy to the configuration MBean hierarchy and back:
wls:/mydomain/serverRuntime/JVMRuntime/managed1> serverConfig()
Location changed to serverConfig tree. This is a read-only tree with
DomainMBean as the root.
For more help, use help('serverConfig')
wls:/mydomain/serverConfig> cd ('Servers/managed1')
wls:/mydomain/serverConfig/Servers/managed1> cd('Log/managed1')
wls:/mydomain/serverConfig/Servers/managed1/Log/managed1> serverRuntime()
wls:/mydomain/serverRuntime/JVMRuntime/managed1>
Entering the serverConfig command from the runtime MBean hierarchy again places WLST
at the configuration MBean to which you last navigated.
wls:/mydomain/serverRuntime/JVMRuntime/managed1> serverConfig()
wls:/mydomain/serverConfig/Servers/managed1/Log/managed1>
Alternatively, you can use the currentTree command to store your current MBean hierarchy
location and to return to that location after navigating away from it. See “currentTree” on
page A-4.
For example:
wls:/mydomain/serverConfig/Servers/managed1/Log/managed1> myLocation =
currentTree()
wls:/mydomain/serverConfig/Servers/managed1/Log/managed1> serverRuntime()
wls:/mydomain/serverRuntime> cd(‘JVMRuntime/managed1’)
wls:/mydomain/serverRuntime/JVMRuntime/managed1>myLocation()
wls:/mydomain/serverConfig/Servers/managed1/Log/managed1>
Finding MBeans
To locate a particular MBean and attribute, you use the find command. WLST returns the
pathname to the MBean that stores the attribute and its value. You can use the getMBean
command to return the MBean specified by the path. For more information, see “find” on
page A-72 and “getMBean” on page A-74.
For example:
wls:/mydomain/edit !> find('logfilename')
searching ...
/ApplicationRuntimes/myserver_wlnav.war/WebAppComponentRuntime/myserver_my
server_wlnav.war_wlnav_/wlnavLogFilename null
/Servers/myserver JDBCLogFileName jdbc.log
/Servers/myserver/WebServer/myserver LogFileName access.log
wls:/mydomain/edit !> bean=getMBean('Servers/myserver/WebServer/myserver')
wls:/mydomain/edit !> print bean
[MBeanServerInvocationHandler]mydomain:Name=myserver,Type=WebServer,Server
=myserver
wls:/mydomain/edit !>
Note: getMBean does not throw an exception when an instance is not found.
Alternatively, the getPath command returns the MBean path for a specified MBean instance or
ObjectName for the MBean in the current MBean hierarchy. See “getPath” on page A-76.
wls:/mydomain/serverConfig>path=getPath('com.bea:Name=myserver,Type=Server
')
wls:/mydomain/serverConfig> print path
Servers/myserver
1. To start the change process, enter the edit command. See “edit” on page A-118.
This places WLST at the root of the editable configuration hierarchy and obtains an
exclusive configuration lock.
The startEdit command must be called prior to invoking any command to modify the
domain configuration. However, if WLST detects that there is an edit session that is
already in progress by the same user, which might have been started via the Administration
Console or another WLST session, it continues your edit session and you need not enter
the startEdit command. For detailed information about startEdit command
arguments, see “startEdit” on page A-59.
To avoid the possibility that the configuration is locked indefinitely, you can specify a
time-out period. Alternatively, an administrator can enter the cancelEdit command to
cancel an edit session and release the lock. See “cancelEdit” on page A-44.
To indicate that configuration changes are in process, an exclamation point (!) appears at
the end of the WLST command prompt.
3. Use WLST edit commands to create, get and set values for, invoke operations on, and
delete instances of configuration MBeans. See “Editing Commands” on page A-37.
Use the validate command to ensure that changes you make are valid before saving
them. See “validate” on page A-65.
5. You can make additional changes, without re-entering the startEdit command, or undo
changes you have made by entering the undo command.
The undo command reverts all changes that have not been saved. See “undo” on
page A-64.
6. When you are ready to distribute your changes to the working configuration MBeans, enter
the activate command.
The activate command initiates the distribution of the changes and releases the lock; the
exclamation point is removed from the command prompt. See “activate” on page A-39.
7. Alternatively, you can abandon your changes by entering the stopEdit or the cancelEdit
command.
The stopEdit command stops the current editing session and releases the edit lock. This
command lets you discard any changes you made since last entering the save command.
See “stopEdit” on page A-60.
The cancelEdit command also stops the editing session and releases the configuration
lock, discarding changes made since the last save command. However, the user entering
this command does not have to be the current editor; this allows an administrator to cancel
an edit session. See “cancelEdit” on page A-44.
The WLST online script in Listing 4-5 connects WLST to an Administration Server, initiates an
edit session that creates a Managed Server, saves and activates the change, initiates another edit
session, creates a startup class, and targets it to the newly created server.
Start WebLogic Server before running this script. See “Running Scripts” on page 2-10.
connect("username","password")
edit()
startEdit()
svr = cmo.createServer("managedServer")
svr.setListenPort(8001)
svr.setListenAddress("my-address")
save()
activate(block="true")
startEdit()
sc = cmo.createStartupClass("my-startupClass")
sc.setClassName("com.bea.foo.bar")
sc.setArguments("foo bar")
tBean = getMBean("Servers/managedServer")
if tBean != None:
print "Found our target"
sc.addTarget(tBean)
save()
activate(block="true")
disconnect()
exit()
If you attempt to make changes without first entering the edit command, WLST displays a
message stating that you have not locked the configuration for changes and gives you the
opportunity to do so. If you forget to call save after entering the startEdit command and
attempt to exit the scripting shell, you are warned about the outstanding, non-committed changes.
At that point you can commit or abandon all changes that you made to the configuration.
To determine if a change you made to an MBean attribute requires you to re-start the server, enter
the isRestartRequired command. If you enter the command during an edit session, before
activating your changes, it will show the attribute changes in progress that will require you to
re-start the server. If you enter the command after activating your changes, it displays the attribute
changes that occurred that require you to re-start the server. See “isRestartRequired” on
page A-51.
connect("theAdministrator","weblogic")
cmgr = getConfigManager()
user = cmgr.getCurrentEditor()
if user == "operatorSam":
cmgr.undo()
cmgr.cancelEdit()
cmgr.purgeCompletedActivationTasks()
Start WebLogic Server before running this script. See “Running Scripts” on page 2-10.
wls:/offline> connect('username','password')
wls:/mydomain/serverConfig> edit()
wls:/mydomain/edit> startEdit()
Starting an edit session ...
wls:/mydomain/edit !> cmo.createServer('managed2')
[MBeanServerInvocationHandler]mydomain:Name=managed2,Type=Server
wls:/mydomain/edit !> cd('Servers/managed2')
wls:/mydomain/edit/Servers/managed2 !> cmo.setListenPort(7702)
wls:/mydomain/edit/Servers/managed2 !> showChanges()
Changes that are in memory and saved to disc but not yet activated are:
The Activation task for your changes is assigned to the variable 'activationTask'
[MBeanServerInvocationHandler]mydomain:Type=ActivationTask
wls:/mydomain/edit/Servers/managed2>
The getActivationTask function provides information about the activation request and returns
the latest ActivationTaskMBean which reflects the state of changes that a user is currently
making or made recently. You invoke the methods that this interface provides to get information
about the latest activation task in progress or just completed. For detailed information, see
ActivationTaskMBean in the WebLogic Server MBean Reference.
The WLST online script in Listing 4-8 connects WLST to a server instance as an administrator,
gets the activation task, and prints the user and the status of the task. It also prints all the changes
that took place.
Start WebLogic Server before running this script. See “Running Scripts” on page 2-10.
connect("theAdministrator","weblogic")
at = getActivationTask()
print "The user for this Task "+at.getUser()+" and the state is "+at.getState()
changes = at.getChanges()
for i in changes:
i.toString()
The following sections describe how to start and stop WebLogic Server instances and monitor
and manage the server life cycle using WebLogic Scripting Tool (WLST):
z Start an Administration Server, with or without Node Manager. See “Starting and Stopping
Servers” on page 5-2.
z Use WLST as a Node Manager client for starting, suspending, and stopping servers
remotely. See “Using WLST and Node Manager to Manage Servers” on page 5-4.
z Retrieve information about the runtime state of WebLogic Server instances. See
“Monitoring Server State” on page 5-6.
z Manage the life cycle of a server instance; for example, control the states through which a
server instance transitions. See “Managing Server State” on page 5-7.
For more information about the server life cycle and managing servers, see “Understanding
Server Life Cycle” and “Using Node Manager to Control Servers” in Managing Server Startup
and Shutdown.
1. If you have not already done so, use WLST to create a domain.
For more information, see “Creating and Configuring WebLogic Domains Using WLST
Offline” on page 3-1.
2. Open a shell (command prompt) on the computer on which you created the domain.
3. Invoke and connect WLST to a running WebLogic Administration Server instance using the
connect command.
c:\>java weblogic.WLST
wls:/(offline)> connect('username','password')
Connecting to weblogic server instance running at t3://localhost:7001
as username weblogic ...
Successfully connected to Admin Server 'myserver' that belongs to
domain 'mydomain'.
Warning: An insecure protocol was used to connect to the server.
To ensure on-the-wire security, the SSL port or Admin port should be
used instead.
wls:/mydomain/serverConfig>
For detailed information about connect command arguments, see “connect” on page A-10.
For example,
start('managed1','Server','t3://localhost:7701')
5. For each Managed Server in the Administration Server’s domain that you want to start,
repeat step 4.
The start command starts Managed Servers or clusters in a domain using Node Manager.
To use the start command, WLST must be connected to a running Administration Server.
To start Managed Servers without requiring a running Administration Server, use the
nmStart command with WLST connected to Node Manager. See “Using WLST and Node
Manager to Manage Servers” on page 5-4.
To start clusters,
wls:/mydomain/serverConfig> start('mycluster', 'Cluster')
Starting the following servers in Cluster, mycluster: MS1, MS2, MS3...
......................................................................
All servers in the cluster mycluster are started successfully.
wls:/mydomain/serverConfig>
and automatically restart them after a failure. For more information about Node Manager, see
“Using Node Manager to Control Servers” in Managing Server Startup and Shutdown.
You can start, stop, and restart server instances remotely or locally, using WLST as a Node
Manager client. In addition, WLST can obtain server status and retrieve the contents of the server
output log.
You connect WLST to a running Node Manager instance in order to invoke Node Manager
supported commands. Node Manager commands issued via WLST are processed by the Node
Manager on the system hosting the target server instances. After being authenticated by Node
Manager, you need not re-authenticate each time you enter a Node Manager command.
In addition, you can enroll the machine on which WLST is running to be monitored by Node
Manager by entering the nmEnroll command. You must run this command once per domain per
machine unless that domain shares the root directory of the Administration Server. WLST must
be connected to an Administration Server to run this command; WLST does not need to be
connected to the Node Manager. See “nmEnroll” on page A-104.
Communications from WLST to the Node Manager process on a machine include:
z Commands to determine the availability of the Node Manager process and the health state
of the server instances under Node Manager control
1. Invoke WLST.
java weblogic.WLST
2. Start Node Manager. (See step 2. in “Starting Managed Servers and Clusters With Node
Manager”)
For example,
nmConnect('weblogic', 'weblogic', 'localhost', '5556',
'mydomain','c:/bea/user_projects/domains/mydomain','ssl')
5. Monitor the status of the server you started by entering the nmServerStatus command.
wls:/nm/mydomain>nmServerStatus('serverName')
RUNNING
wls:/nm/mydomain>
z Monitor the availability of server instances and the applications they host.
z Plan correction actions, such as migration of services, when a server instance fails or
crashes.
Using WLST, you can obtain the state of a server instance in the following ways:
connect("username","password","t3://localhost:8001")
You can use the WebLogic Scripting Tool (WLST) to automate the creation and management of
WebLogic Server domains, servers, and resources. WLST provides commands that create, get
and set values for, invoke operations on, and delete instances of configuration MBeans and
commands to get values and invoke operations on runtime MBeans. The following sections
describe using WLST commands online to automate typical domain and server configuration
tasks:
z Use WLST offline to create a new domain or update an existing domain without
connecting to a running WebLogic Server. WLST offline supports the same functionality
as the Configuration Wizard. See “Creating and Configuring WebLogic Domains Using
WLST Offline” on page 3-1.
z Use the WebLogic Server Ant tasks. For almost all configuration needs, the Ant tasks and
the weblogic.Server, weblogic.Admin (deprecated in this release of WebLogic Server),
and weblogic.Deployer commands are functionally equivalent. See “Using Ant Tasks to
Configure and Use a WebLogic Server Domain” in Developing Applications with
WebLogic Server.
2. Creates and starts an Administration Server. See “Creating a Domain” on page 6-3.
3. After the domain’s Administration Server has completed its startup cycle, connects WLST
to the server and configures resources for the domain. See:
– “Creating JDBC Resources” on page 6-3
– “Creating JMS Resources” on page 6-4
– “Creating Mail Resources” on page 6-5
4. Invokes multiple WLST deploy commands to deploy J2EE modules such as EJBs and
Enterprise applications. See “Deploying Applications” on page 6-6.
where WL_HOME refers to the top-level installation directory for WebLogic Server.
If you want to use JDBC resources to connect to a database, modify the environment as the
database vendor requires. Usually this entails adding driver classes to the CLASSPATH variable
and vendor-specific directories to the PATH variable. To set the environment that the sample
PointBase database requires as well as add an SDK to PATH variable and the WebLogic Server
classes to the CLASSPATH variable, invoke the following script:
WL_HOME\samples\domains\wl_server\setExamplesEnv.cmd (on Windows)
WL_HOME/samples/domains/wl_server/setExamplesEnv.sh (on UNIX)
Creating a Domain
The commands in Listing 6-1 create a domain named MedRecDomain with an Administration
Server named medrec-adminServer that listens on port 8001, and connect WLST to the server
instance.
debug()
dsname="myJDBCDataSource"
adminServerName="medrec-adminServer"
domainName="MedRecDomain"
_url="t3://localhost:8001"
uname="weblogic"
pwd="weblogic"
startNewServer(adminServerName,domainName,_url,domainDir=domainDir.getPath(),
block="true")
connect(uname, pwd, _url)
edit()
startEdit()
Note: The command specifies a listen port of 8001 because the sample MedRec domain that
WebLogic Server installs listens on the default port 7011. If the sample MedRec domain
is running, the 7011 listen port cannot be used by another server instance.
dsname="myJDBCDataSource"
connectionPoolParams = theJDBCResource.getJDBCConnectionPoolParams()
connectionPoolParams.setConnectionReserveTimeoutSeconds(25)
connectionPoolParams.setMaxCapacity(100)
connectionPoolParams.setTestTableName("SYSTABLES")
dsParams = theJDBCResource.getJDBCDataSourceParams()
dsParams.addJNDIName("ds.myJDBCDataSource")
driverParams = theJDBCResource.getJDBCDriverParams()
driverParams.setUrl("jdbc:pointbase:server://localhost/demo")
driverParams.setDriverName("com.pointbase.xa.xaDataSource")
#driverParams.setUrl("jdbc:oracle:thin:@my-oracle-server:my-oracle-server-port
:my-oracle-sid")
#driverParams.setDriverName("oracle.jdbc.driver.OracleDriver")
driverParams.setPassword("examples")
#driverParams.setLoginDelaySeconds(60)
driverProperties = driverParams.getProperties()
proper = driverProperties.createProperty("user")
#proper.setName("user")
proper.setValue("examples")
proper1 = driverProperties.createProperty("DatabaseName")
#proper1.setName("DatabaseName")
proper1.setValue("jdbc:pointbase:server://localhost/demo")
See “Using the WebLogic Scripting Tool to Manage JMS Servers and JMS System Resources”
in Configuring and Managing WebLogic JMS.
To see all attributes and legal values of the MailSessionMBean, see MailSessionMBean in the
WebLogic Server MBean Reference. For more information about the WebLogic Server mail
service, see "Configure Access to JavaMail" in the Administration Console Online Help.
Deploying Applications
The commands in Listing 6-5 deploy sample applications in MedRecDomain.
# Deploying Applications
deploy("PhysicianEAR","C:/bea/weblogic90/samples/server/medrec/src/physicianEa
r","medrec-adminServer",securityModel="Advanced",block="true")
deploy("StartupEAR","C:/bea/weblogic90/samples/server/medrec/src/startupEar","
medrec-adminServer",securityModel="Advanced",block="true")
deploy("MedRecEAR","C:/bea/weblogic90/samples/server/medrec/src/medrecEAR","me
drec-adminServer",securityModel="Advanced",block="true")
Notes:
z You must invoke these commands on the computer that hosts the Administration Server for
MedRecDomain.
z Because the sample applications use JDBC connection pools, you must specify the JDBC
driver in the CLASSPATH environment variable. See “Setting Up the Environment” on
page 6-2.
z To use JDBC resources in MedRecDomain, you must start the database before running the
script.
1. Copy and save the commands in Listing 6-6 in a text file with a .py file extension; for
example, cloneDomain.py.
2. Set the required environment variables. See “Setting Up the Environment” on page 6-2.
Use WL_HOME\samples\domains\wl_server\setExamplesEnv.cmd to set the variables
required for running this script.
3. Invoke WLST and run the sample script by entering the following command:
java weblogic.WLST <filepath>/cloneDomain.py
For more information on how to run this script, see “Running Scripts” on page 2-10.
debug()
dsname="myJDBCDataSource"
adminServerName="medrec-adminServer"
domainName="MedRecDomain"
_url="t3://localhost:8001"
uname="weblogic"
pwd="weblogic"
startNewServer(adminServerName,domainName,_url,domainDir=domainDir.getPath(),
block="true")
connect(uname, pwd, _url)
edit()
startEdit()
connectionPoolParams = theJDBCResource.getJDBCConnectionPoolParams()
connectionPoolParams.setConnectionReserveTimeoutSeconds(25)
connectionPoolParams.setMaxCapacity(100)
connectionPoolParams.setTestTableName("SYSTABLES")
dsParams = theJDBCResource.getJDBCDataSourceParams()
dsParams.addJNDIName("ds.myJDBCDataSource")
driverParams = theJDBCResource.getJDBCDriverParams()
driverParams.setUrl("jdbc:pointbase:server://localhost/demo")
driverParams.setDriverName("com.pointbase.xa.xaDataSource")
#driverParams.setUrl("jdbc:oracle:thin:@my-oracle-server:my-oracle-server-port
:my-oracle-sid")
#driverParams.setDriverName("oracle.jdbc.driver.OracleDriver")
driverParams.setPassword("examples")
#driverParams.setLoginDelaySeconds(60)
driverProperties = driverParams.getProperties()
proper = driverProperties.createProperty("user")
#proper.setName("user")
proper.setValue("examples")
proper1 = driverProperties.createProperty("DatabaseName")
#proper1.setName("DatabaseName")
proper1.setValue("jdbc:pointbase:server://localhost/demo")
ssl = tgt.getSSL()
ssl.setEnabled(1)
ssl.setIdentityAndTrustLocations("KeyStores")
ssl.setListenPort(9992)
save()
activate(block="true")
shutdown(force="true",block="true")
print 'end of the script ... '
1. Invoke WLST and connect to a running Administration Server instance. See “Invoking
WLST” on page 2-8.
The domainRuntime command places WLST at the root of the domain-wide runtime
management objects, DomainRuntimeMBean.
3. Navigate to ServerRuntimes and then to the server instance which you are interested in
monitoring.
wls:/mydomain/domainRuntime>cd('ServerRuntimes/myserver')
The following sections provide example scripts for retrieving runtime information about
WebLogic Server server instances and domain resources.
import thread
import time
def checkHealth(serverName):
while 1:
slBean = getSLCRT(serverName)
status = slBean.getState()
print 'Status of Managed Server is '+status
if status != "RUNNING":
print 'Starting server '+serverName
start(serverName, block="true")
time.sleep(5)
def getSLCRT(svrName):
domainRuntime()
slrBean = cmo.lookupServerLifecycleRuntime(svrName)
return slcBean
waitTime=300000
THRESHOLD=100000000
uname = "weblogic"
pwd = "weblogic"
url = "t3://localhost:7001"
def monitorJVMHeapSize():
connect(uname, pwd, url)
while 1:
serverNames = getRunningServerNames()
domainRuntime()
for name in serverNames:
print 'Now checking '+name.getName()
try:
cd("/ServerRuntimes/"+name.getName()+"/JVMRuntime/"+name.getName())
except WLSTException,e:
# this typically means the server is not active, just ignore
pass
heapSize = cmo.getHeapSizeCurrent()
if heapSize > THRESHOLD:
# do whatever is neccessary, send alerts, send email etc
print 'WARNING: The HEAPSIZE is Greater than the Threshold'
else:
print heapSize
java.lang.Thread.sleep(1800000)
def getRunningServerNames():
domainConfig()
return cmo.getServers()
if __name__== "main":
monitorJVMHeapSize()
Managing Security
In the WebLogic Security Service, an Authentication provider is the software component that
proves the identity of users or system processes. An Authentication provider also remembers,
transports, and makes that identity information available to various components of a system when
needed. A security realm can use different types of Authentication providers to manage different
sets of users and groups. See "Authentication Providers" in Developing Security Providers for
WebLogic Server.
You can use WLST to invoke operations on the following types of Authentication providers:
For information about additional tasks that the AuthenticationProvider and the optional
MBeans support, refer to weblogic.management.security.authentication package in the
WebLogic Server MBean Reference.
Note: WebLogic Server 6.0 style security MBeans are accessible using WLST but are not
displayed using the ls command. For example, if you enter the following commands,
WLST lists the domain MBeans, but not excluded attributes, such as FileRealms:
java weblogic.WLST
connect()
ls()
However, if you enter the following commands, WLST displays the DomainMBean’s file
realms:
java weblogic.WLST
connect()
cmo.getFileRealms()
Creating a User
To create a user, invoke the UserEditorMBean.createUser method, which is extended by the
security realm’s AuthenticationProvider MBean. For more information, see the
createUser method in the WebLogic Server MBean Reference.
The following WLST online script invokes createUser on the default Authentication Provider.
For information on how to run this script, see “Running Scripts” on page 2-10.
The following WLST online script invokes addMemberToGroup on the default Authentication
Provider. For information on how to run this script, see “Running Scripts” on page 2-10.
where boolean specifies whether the command searches within child groups. If you specify
true, the command returns true if the member belongs to the group that you specify or to any
of the groups contained within that group.
The following WLST online script invokes isMember on the default Authentication Provider.
For information on how to run this script, see “Running Scripts” on page 2-10.
methods iterate through the returned list and retrieve the name to which the current cursor
position refers. See the weblogic.management.utils.NameLister interface in the WebLogic
Server MBean Reference.
z The NameLister.close method releases any server-side resources that are held on behalf
of the list.
The WLST online script in Listing 6-13 lists all the users in a realm and the groups to which they
belong. For information on how to run this script, see “Running Scripts” on page 2-10.
realm=cmo.getSecurityConfiguration().getDefaultRealm()
atns = realm.getAuthenticationProviders()
for i in atns:
if isinstance(i,UserReaderMBean):
userReader = i
cursor = i.listUsers("*",0)
print 'Users in realm '+realm.getName()+' are: '
while userReader.haveCurrent(cursor):
print userReader.getCurrentName(cursor)
userReader.advance(cursor)
userReader.close(cursor)
for i in atns:
if isinstance(i,GroupReaderMBean):
groupReader = i
cursor = i.listGroups("*",0)
print 'Groups in realm are: '
while groupReader.haveCurrent(cursor):
print groupReader.getCurrentName(cursor)
groupReader.advance(cursor)
groupReader.close(cursor)
Changing a Password
To change a user’s password, invoke the UserPasswordEditorMBean.changeUserPassword
method, which is extended by the security realm’s AuthenticationProvider MBean. For
more information, see the changeUserPassword method in the WebLogic Server MBean
Reference.
The following WLST online script invokes changeUserPassword on the default Authentication
Provider: For information on how to run this script, see “Running Scripts” on page 2-10.
locked, increase the time period in which invalid login attempts are made before locking the user
account, or change the amount of time a user account is locked.
The AuthenticationProvider MBean does not extend methods that you use to protect user
accounts. Instead, retrieve the UserLockoutManagerMBean and invoke its methods. For more
information, see the UserLockoutManagerMBean interface in the WebLogic Server MBean
Reference.
The following tasks provide examples for invoking UserLockoutManagerMBean methods:
edit()
startEdit()
#You have two choices for getting a user lockout manager to configure
# 1 - to configure the default realm's UserLockoutManager:
ulm=cmo.getSecurityConfiguration().getDefaultRealm().getUserLockoutManager()
ulm.setLockoutThreshold(3)
save()
activate()
serverRuntime()
ulm=cmo.getServerSecurityRuntime().getDefaultRealmRuntime().getUserLockoutMana
gerRuntime()
#note1 : You can only manage user lockouts for the default realm starting from
when the server was booted (versus other non-active realms).
#note2 : If the default realm's user lockout manager's LockoutEnabled attribute
is false, then the user lockout manager’s runtime MBean will be null.
#That is, you can only manage user lockouts in the default realm if its user
lockout manager is enabled.
if ulm != None:
ulm.clearLockout("myuser")
Configuring Logging
Using WLST, you can configure a server instance’s logging and message output.
To determine which log attributes can be configured, see LogMBean and LogFileMBean in the
WebLogic Server MBean Reference. The reference also indicates valid values for each attribute.
The WLST online script in Listing 6-17 get and set several LogMBean and LogFileMBean
attributes. For information on how to run this script, see “Running Scripts” on page 2-10.
username = System.getProperty("user","weblogic")
password = System.getProperty("password","weblogic")
adminHost = System.getProperty("adminHost","localhost")
adminPort = System.getProperty("adminPort","7001")
protocol = System.getProperty("protocol","t3")
url = protocol+"://"+adminHost+":"+adminPort
fileCount = Integer.getInteger("fileCount", 5)
fileMinSize = Integer.getInteger("fileMinSize", 400)
fileName =
System.getProperty("fileName","config\\mydomain\\myserver\\myserver.log")
fileTimeSpan = Integer.getInteger("fileTimeSpan", 12)
log4jEnabled = System.getProperty("log4jEnabled", "true")
stdoutSeverity = System.getProperty("stdoutSeverity", "Info")
logBRSeverity = System.getProperty("logBRSeverity", "Info")
logFileSeverity = System.getProperty("logFileSeverity", "Info")
memBufferSeverity = System.getProperty("memBufferSeverity", "Info")
memBufferSize = Integer.getInteger("memBufferSize", 400)
numOfFilesLimited = System.getProperty("numOfFilesLimited", "true")
redirectStdout = System.getProperty("redirectStdout", "true")
redirectStdErr = System.getProperty("redirectStdErr", "true")
rotateOnStartup = System.getProperty("rotateOnStartup", "false")
rotateTime = System.getProperty("rotateTime", "00:10")
rotateType = System.getProperty("rotateType", "byTime")
save()
activate()
print
ls ()
# all done...
exit()
For example scripts that demonstrate using WLST to configure the WebLogic Diagnostic
Framework, see “WebLogic Scripting Tool Examples” in Configuring and Using the WebLogic
Diagnostics Framework.
The following sections describe the WLST commands and variables in detail. Topics include:
Browse Commands Navigate the hierarchy of configuration or runtime beans and control the
prompt display.
Deployment Commands • Deploy, undeploy, and redeploy applications and standalone modules to a
WebLogic Server instance.
• Update an existing deployment plan.
• Interrogate the WebLogic Deployment Manager object.
• Start and stop a deployed application.
Information Commands Interrogate domains, servers, and variables, and provide configuration bean,
runtime bean, and WLST-related information.
Node Manager Commands Start, shut down, restart, and monitor WebLogic Server instances using Node
Manager.
Browse Commands
Use the WLST browse commands, listed in Table A-2, to navigate the hierarchy of configuration
or runtime beans and control the prompt display.
“cd” on page A-3 Navigate the hierarchy of configuration or runtime beans. Online or
Offline
“prompt” on page A-5 Toggle the display of path information at the prompt. Online or
Offline
“pwd” on page A-6 Display the current location in the hierarchy. Online or
Offline
cd
Command Category: Browse Commands
Use with WLST: Online or Offline
Description
Navigates the hierarchy of configuration or runtime beans. This command uses a model that is
similar to navigating a file system in a Windows or UNIX command shell. For example, to
navigate back to a parent configuration or runtime bean, enter cd('..'). The character string..
(dot-dot), refers to the directory immediately above the current directory. To get back to the root
bean after navigating to a bean that is deep in the hierarchy, enter cd('/').
You can navigate to beans in the current hierarchy and to any child or instance.
The cd command returns a stub of the configuration or runtime bean instance, if one exists. If you
navigate to a type, this command returns a stub of the configuration or runtime bean instance from
which you navigated. In the event of an error, the command returns a WLSTException.
Note: The cmo variable is initialized to the root of all domain configuration beans when you
first connect WLST to a server instance. It reflects the parent configuration bean type
until you navigate to an instance. For more information about the cmo variable, see
“Changing the Current Management Object” on page 4-3.
Syntax
cd(mbeanName)
Argument Definition
mbeanName Path to the bean in the namespace.
Examples
The following example navigates the hierarchy of configuration beans. The first command
navigates to the Servers configuration bean type, the second, to the myserver configuration
bean instance, and the last back up two levels to the original directory location.
wls:/mydomain/serverConfig> cd('Servers')
wls:/mydomain/serverConfig/Servers> cd('myserver')
wls:/mydomain/serverConfig/Servers/myserver> cd('../..')
wls:/mydomain/serverConfig>
currentTree
Command Category: Browse Commands
Use with WLST: Online
Description
Returns the current location in the hierarchy. This command enables you to store the current
location in the hierarchy and easily return to it after browsing. In the event of an error, the
command returns a WLSTException.
Syntax
currentTree()
Example
The following example stores the current location in the hierarchy in myTree and uses it to
navigate back to the Edit MBean hierarchy from the runtime MBean hierarchy on an
Administration Server instance.
wls:/mydomain/edit> myTree=currentTree()
wls:/mydomain/edit> serverRuntime()
Location changed to serverRuntime tree. This is a read-only tree with
ServerRuntimeMBean as the root.
For more help, use help('serverRuntime')
wls:/mydomain/serverRuntime> myTree()
wls:/mydomain/edit>
prompt
Command Category: Browse Commands
Use with WLST: Online or Offline
Description
Toggles the display of path information at the prompt, when entered without an argument. This
command is useful when the prompt becomes too long due to the length of the path.
You can also explicitly specify on or off as an argument to the command. When you specify off,
WLST hides the WLST prompt and defaults to the Jython prompt. By default, the WLST prompt
displays the configuration or runtime navigation path information.
When you disable the prompt details, to determine your current location in the hierarchy, you can
use the pwd command, as described in “pwd” on page A-6.
In the event of an error, the command returns a WLSTException.
Syntax
prompt(myPrompt)
Argument Definition
myPrompt Optional. Hides or displays WLST prompt. Valid values include off or on.
• The off argument hides the WLST prompt.
If you run prompt('off'), when using WLST online, the prompt defaults to the
Jython prompt. You can create a new prompt using Jython syntax. For more
information about programming using Jython, see http://www.jython.org.
In this case, if you subsequently enter the prompt command without arguments,
WLST displays the WLST command prompt without the path information. To
redisplay the path information, enter prompt() again, or enter prompt('on').
• The on argument displays the default WLST prompt, including the path
information.
Examples
The following example hides and then redisplays the path information at the prompt.
wls:/mydomain/serverConfig/Servers/myserver> prompt()
wls:/> prompt()
wls:/mydomain/serverConfig/Servers/myserver>
The following example hides the prompt and defaults to the Jython prompt (since the command
is run using WLST online), changes the Jython prompt, and then redisplays the WLST prompt.
This example also demonstrates the use of the pwd command.
Note: For more information about programming using Jython, see http://www.jython.org.
wls:/mydomain/serverConfig/Servers/myserver> prompt('off')
>>>sys.ps1="myprompt>"
myprompt> prompt()
wls:> pwd()
‘serverConfig:Servers/myserver’
wls:> prompt()
wls:/mydomain/serverConfig/Servers/myserver>
pwd
Command Category: Browse Commands
Use with WLST: Online or Offline
Description
Displays the current location in the configuration or runtime bean hierarchy.
This command is useful when you have turned off the prompt display of the path information
using the prompt command, as described in “prompt” on page A-5.
In the event of an error, the command returns a WLSTException.
Syntax
pwd()
Example
The following example displays the current location in the configuration bean hierarchy.
wls:/mydomain/serverConfig/Servers/myserver/Log/myserver> pwd()
'serverConfig:/Servers/myserver/Log/myserver'
Control Commands
Use the WLST control commands, listed in Table A-3, to perform the following tasks:
z Create and configure a WebLogic domain or domain template, similar to the Configuration
Wizard
z Exit WLST
Table A-3 lists the control commands for WLST configuration.
Create a new domain “readTemplate” on page A-16 Open an existing domain Offline
from a domain template template for domain creation.
Update an existing “readDomain” on page A-15 Open an existing domain for Offline
domain (offline) updating.
Exit WLST “exit” on page A-14 Exit WLST from the interactive Online or
session and close the scripting Offline
shell.
addTemplate
Command Category: Control Commands
Use with WLST: Offline
Description
Extends the current domain using an application or service extension template. In the event of an
error, the command returns a WLSTException.
Syntax
addTemplate(templateFileName)
Argument Definition
templateFileName Name of the application or service extension template.
Example
The following example opens a domain and extends it using the specified extension template,
DefaultWebApp.jar.
wls:/offline> readDomain('c:/bea/user_projects/domains/wlw')
wls:/offline/wlw> addTemplate('c:/bea/weblogic90/common/templates/
applications/DefaultWebApp.jar')
wls:/offline/wlw>
closeDomain
Command Category: Control Commands
Use with WLST: Offline
Description
Closes the current domain. The domain is no longer available for editing once it is closed. In the
event of an error, the command returns a WLSTException.
Syntax
closeDomain()
Example
The following example closes the current domain:
wls:/offline> readDomain('c:/bea/user_projects/domains/medrec')
...
wls:/offline/medrec> updateDomain()
wls:/offline/medrec> closeDomain()
wls:/offline>
closeTemplate
Command Category: Control Commands
Use with WLST: Offline
Description
Closes the current domain template. The domain template is no longer available once it is closed.
In the event of an error, the command returns a WLSTException.
Syntax
closeTemplate()
Example
The following example opens an existing domain template, performs some operations, and then
closes the current domain template.
wls:/offline> readTemplate('c:/bea/weblogic81/common/templates/domains/
wls.jar')
...
wls:/offline/wls> closeTemplate()
wls:/offline>
connect
Command Category: Control Commands
Use with WLST: Online or Offline
Description
Connects WLST to a WebLogic Server instance.
You can specify the username and password on the command line, or you can specify an
encrypted password that is stored locally by specifying the locations of the user configuration and
key files as arguments to the connect command. For information about creating the user
configuration and key files, see “storeUserConfig” on page A-87.
If you run the connect command without specifying the username and password, WLST
attempts to process the command using one of the methods listed below (in order of precedence):
1. WLST searches for the default user configuration and key files that contain an encrypted
username and password. This information must be valid for your current domain.
2. If the connect command was run from the domain directory in which the server was
started, WLST attempts to load the username and password from the boot.properties
file.
z BEA Systems strongly recommends that you connect WLST to the server through the SSL
port or administration port. If you do not, the following warning message is displayed:
Warning: An insecure protocol was used to connect to the server. To ensure
on-the-wire security, the SSL port or Admin port should be used instead.
z If you are connecting to a WebLogic Server instance through an SSL listen port on a server
that is using the demonstration SSL keys and certificates, you should invoke WLST using
the following command:
java -Dweblogic.security.SSL.ignoreHostnameVerification=true
-Dweblogic.security.TrustKeyStore=DemoTrust weblogic.WLST
For more information about invoking WLST, see “Main Steps for Using WLST” on
page 2-8.
z If you are connecting to a WebLogic Server instance via HTTP, ensure that the
TunnelingEnabled attribute is set to true for the WebLogic Server instance. For more
information, see “TunnelingEnabled” in WebLogic Server Configuration Reference at
http://e-docs.bea.com/wls/docs90/wlsmbeanref/mbeans/ServerMBean.html?sk
ipReload=true#TunnelingEnabled.
After successfully connecting to a WebLogic Server instance, all the local variables are
initialized.
In the event of an error, the command returns a WLSTException.
Syntax
connect([username, password], [url], [adminServerName])
Argument Definition
username Optional. Username of the operator who is connecting WLST to the server. If
not specified, WLST processes the command as described above.
password Optional. Password of the operator who is connecting WLST to the server. If not
specified, WLST processes the command as described above.
url Optional. Listen address and listen port of the server instance, specified using
the following format: [protocol://]listen-address:listen-port.
If not specified, this argument defaults to t3://localhost:7001.
userConfigFile Optional. Name and location of a user configuration file which contains an
encrypted username and password.
When you create a user configuration file, the storeUserConfig command
uses a key file to encrypt the username and password. Only the key file that
encrypts a user configuration file can decrypt the username and password. (See
“storeUserConfig” on page A-87.)
userKeyFile Optional. Name and location of the key file that is associated with the specified
user configuration file and is used to decrypt it. (See “storeUserConfig” on
page A-87.)
adminServerName Optional. Name of the Administration Server. This value is used when WLST
is invoked from a domain directory. This argument defaults to AdminServer.
Examples
The following example connects WLST to a WebLogic Server instance. In this example, the
Administration Server name defaults to AdminServer. Note that a warning is displayed if the
SSL or administration port is not used to connect to the server.
wls:/offline> connect('weblogic','weblogic','t3://localhost:8001')
Connecting to weblogic server instance running at t3://localhost:8001 as
username weblogic...
wls:/mydomain/serverConfig>
The following example connects WLST to a WebLogic Server instance at the specified URL. In
this example, the username and password are passed as variables. This example uses a secure
protocol.
wls:/offline> username = 'weblogic'
wls:/offline> password = 'weblogic'
wls:/offline> connect(username,password,'t3s://myhost:8001')
Connecting to weblogic server instance running at t3://myhost:8001 as
username weblogic...
The following example connects WLST to a WebLogic Server instance using a user
configuration and key file to provide user credentials. The Administration Server name defaults
to AdminServer.
wls:/offline> connect(userConfigFile='c:/myfiles/myuserconfigfile.secure',
userKeyFile='c:/myfiles/myuserkeyfile.secure')
Connecting to weblogic server instance running at t3://localhost:7001 as
username ...
disconnect
Command Category: Control Commands
Use with WLST: Online
Description
Disconnects WLST from a WebLogic Server instance. The disconnect command does not
cause WLST to exit the interactive scripting shell; it closes the current WebLogic Server instance
connection and resets all the variables while keeping the interactive shell alive.
In the event of an error, the command returns a WLSTException.
You can connect to another WebLogic Server instance using the connect command, as
described in “connect” on page A-10.
Syntax
disconnect(force)
Argument Definition
force Optional. Boolean value specifying whether WLST should disconnect without
waiting for the active sessions to complete. This argument defaults to false,
indicating that all active sessions must complete before disconnect.
Example
The following example disconnects from a running server:
wls:/mydomain/serverConfig> disconnect()
Disconnected from weblogic server: myserver
wls:/offline>
exit
Command Category: Control Commands
Use with WLST: Online or Offline
Description
Exits WLST from the user session and closes the scripting shell.
If there is an edit session in progress, WLST prompts you for confirmation. To skip the prompt,
set the defaultAnswer argument to y.
By default, WLST calls System.exit(0) for the current WLST JVM when exiting WLST. If
you would like the JVM to exit with a different exit code, you can specify a value using the
exitCode argument.
Note: When the WLST exit command is issued within an Ant script, it may also exit the
execution of the Ant script. It is recommended that when invoking WLST within an Ant
script, you fork a new JVM by specifying fork="true".
In the event of an error, the command returns a WLSTException.
Syntax
exit([defaultAnswer], [exitcode])
Argument Definition
defaultAnswer Optional. Default response, if you would prefer not to be prompted at the
command line. Valid values are y and n. This argument defaults to null, and
WLST prompts you for a response.
Example
The following example disconnects from the user session and closes the scripting shell.
wls:/mydomain/serverConfig> exit()
Exiting WebLogic Scripting Tool ...
c:\>
The following example disconnects from the user session, closes the scripting shell, and sets the
error code to 101.
wls:/mydomain/serverConfig> exit(exitcode=101)
Exiting WebLogic Scripting Tool ...
c:\>
readDomain
Command Category: Control Commands
Use with WLST: Offline
Description
Opens an existing domain for updating.
When you open a template or domain, WLST is placed into the configuration bean hierarchy for
that domain, and the prompt is updated to reflect the current location in the configuration
hierarchy. For example:
wls:/offline/base_domain>
WebLogic Server configuration beans exist within a hierarchical structure. In the WLST file
system, the hierarchies correspond to drives; types and instances are directories; attributes and
operations are files. WLST traverses the hierarchical structure of configuration beans using
commands such as cd, ls, and pwd in a similar way that you would navigate a file system in a
UNIX or Windows command shell. After navigating to an configuration bean instance, you
interact with the bean using WLST commands. For more information, see “Navigating and
Interrogating MBeans” on page 4-1.
In the event of an error, the command returns a WLSTException.
Syntax
readDomain(domainDirName)
Argument Definition
Example
The following example opens the medrec domain for editing.
wls:/offline> readDomain('c:/bea/user_projects/domains/medrec')
wls:/offline/medrec>
readTemplate
Command Category: Control Commands
Use with WLST: Offline
Description
Opens an existing domain template for domain creation.
When you open a domain template, WLST is placed into the configuration bean hierarchy for that
domain template, and the prompt is updated to reflect the current location in the configuration
hierarchy. For example:
wls:/offline/base_domain>
WebLogic Server configuration beans exist within a hierarchical structure. In the WLST file
system, the hierarchies correspond to drives; types and instances are directories; attributes and
operations are files. WLST traverses the hierarchical structure of configuration beans using
commands such as cd, ls, and pwd in a similar way that you would navigate a file system in a
UNIX or Windows command shell. After navigating to a configuration bean instance, you
interact with the bean using WLST commands. For more information, see “Navigating and
Interrogating MBeans” on page 4-1.
Note: Using WLST and a domain template, you can only create and access security information
when you are creating a new domain. When you are updating a domain, you cannot
access security information through WLST.
In the event of an error, the command returns a WLSTException.
Syntax
readTemplate(templateFileName)
Argument Definition
templateFileName Name of the JAR file corresponding to the domain template.
Example
The following example opens the medrec.jar domain template for domain creation.
wls:/offline> readTemplate('c:/bea/weblogic90/common/templates/domains
/wls_medrec.jar')
wls:/offline/wls_medrec>
updateDomain
Command Category: Control Commands
Use with WLST: Offline
Description
Updates and saves the current domain. The domain continues to be editable after you update and
save it.
In the event of an error, the command returns a WLSTException.
Syntax
updateDomain()
Example
The following examples opens the medrec domain, performs some operations, and updates and
saves the current domain:
wls:/offline> readDomain('c:/bea/user_projects/domains/medrec')
...
wls:/offline/medrec> updateDomain()
writeDomain
Command Category: Control Commands
Use with WLST: Offline
Description
Writes the domain configuration information to the specified directory.
Once you write the domain to file system, you can continue to update the domain template object
that exists in memory, and reissue the writeDomain command to store the domain configuration
to a new or existing file.
By default, when you write a domain, the associated applications are written to
BEAHOME/user_projects/applications/domainname, where BEAHOME specifies the BEA
home directory and domainname specifies the name of the domain. This directory must be empty;
otherwise, WLST displays an error.
When you have finished using the domain template object in memory, close it using the
closeTemplate command. If you want to edit the domain that has been saved to disk, you can
open it using the readDomain command.
Note: The name of the domain is derived from the name of the domain directory. For example,
for a domain saved to c:/bea/user_projects/domains/myMedrec, the domain name
is myMedrec.
Before writing the domain, you must define a password for the default user, if it is not already
defined. For example:
cd('/Security/base_domain/User/weblogic')
cmo.setPassword('weblogic')
Syntax
writeDomain(domainDir)
Argument Definition
domainDir Name of the directory to which you want to write the domain configuration
information.
Example
The following example reads the medrec.jar domain templates, performs some operations, and
writes the domain configuration information to the c:/bea/user_projects/domains/medrec
directory.
wls:/offline> readTemplate('c:/bea/weblogic81/common/templates/domains
/wls.jar')
...
wls:/offline/base_domain>
writeDomain('c:/bea/user_projects/domains/base_domain')
writeTemplate
Command Category: Control Commands
Use with WLST: Offline
Description
Writes the domain configuration information to the specified domain template. You can use the
domain configuration template to recreate the domain.
Once your write the configuration information to the domain configuration template, you can
continue to update the domain or domain template object that exists in memory, and reissue the
writeDomain or writeTemplate command to store the domain configuration to a new or
existing domain or domain template file. For more information, see “writeDomain” on page A-18
or “writeTemplate” on page A-19, respectively.
In the event of an error, the command returns a WLSTException.
Syntax
writeTemplate(templateName)
Argument Definition
templateName Name of the domain template to store the domain configuration information.
Example
The following example writes the current domain configuration to the domain template named
c:/bea/user_projects/templates/myTemplate.jar.
wls:/offline> readDomain('c:/bea/user_projects/domains/mydomain')
...
wls:/offline/base_domain>
writeTemplate('c:/bea/user_projects/templates/myTemplate.jar')
Deployment Commands
Use the WLST deployment commands, listed in Table A-4, to:
“loadApplication” on page A-27 Load an application and deployment plan into Online
memory.
deploy
Command Category: Deployment Commands
Use with WLST: Online
Description
Deploys an application to a WebLogic Server instance.
The deploy command returns a WLSTProgress object that you can access to check the status of
the command. For more information about the WLSTProgress object, see “WLSTProgress
Object” on page C-4. In the event of an error, the command returns a WLSTException.
Note: If there is an edit session in progress, the deploy command does not block user
interaction.
Syntax
deploy(appName, path, [targets], [stageMode], [planPath], [options])
Argument Definition
appName Name of the application or standalone J2EE module to be deployed.
path Name of the application directory, archive file, or root of the exploded archive
directory to be deployed.
targets Optional. Comma-separated list of the target. Each target may be qualified with
a J2EE module name (for example, module1@server1) enabling you to
deploy different modules of the application archive on different servers. This
argument defaults to the server to which WLST is currently connected.
stageMode Optional. Staging mode for the application you are deploying. Valid values are
stage, nostage, and external_stage. For information about the staging
modes, see “Staging Modes” in “Overview of WebLogic Server Deployment”
in Deploying Applications to WebLogic Server at
http://e-docs.bea.com/wls/docs90/deployment/deploy.htm
l#stage. This argument defaults to null.
planPath Optional. Name of the deployment plan file. The filename can be absolute or
relative to the application directory. This argument defaults to the
plan/plan.xml file in the application directory, if one exists.
Example
The following example deploys the businessApp application located at c:/myapps/business,
A default deployment plan is created.
The deploy command returns a WLSTProgress object that you can access to check the status of
the command. The WLSTProgress object is captured in a user-defined variable, in this case,
progress.
wls:/mydomain/serverConfig/Servers> progress=
deploy(appName='businessApp',path='c:/myapps/business',createplan='true')
The previous example stores the WLSTProgress object returned in a user-defined variable, in this
case, progress. You can then use the progress variable to print the status of the deploy
command. For example:
wls:/mydomain/serverConfig/Servers> progress.printStatus()
Current Status of your Deployment:
Deployment command type: deploy
Deployment State : completed
Deployment Message : null
wls:/mydomain/serverConfig/Servers>
For more information about the WLSTProgress object, see “WLSTProgress Object” on
page C-4.
The following example deploys the demoApp application in the archive file located at
c:/myapps/demos/app/demoApp.ear, targeting the application modules to myserver, and
using the deployment plan file located in c:/myapps/demos/app/plan/plan.xml. WLST
waits 120,000 ms for the process to complete.
wls:/mydomain/serverConfig/Servers> deploy('demoApp',
'c:/myapps/demos/app/demoApp.ear', targets='myserver',
planPath='c:/myapps/demos/app/plan/plan.xml', timeout=120000)
distributeApplication
Command Category: Deployment Commands
Use with WLST: Online
Description
Copies the deployment bundle to the specified targets. The deployment bundle includes module,
configuration data, and any additional generated code. The distributeApplication command
does not start deployment.
The distributeApplication command returns a WLSTProgress object that you can access to
check the status of the command. For more information about the WLSTProgress object, see
“WLSTProgress Object” on page C-4. In the event of an error, the command returns a
WLSTException.
Syntax
distributeApplication(appPath, [planPath], [targets], [options])
Argument Definition
appPath Name of the archive file or root of the exploded archive directory to be deployed.
planPath Optional. Name of the deployment plan file. The filename can be absolute or relative to
the application directory. This argument defaults to the plan/plan.xml file in the
application directory, if one exists.
targets Optional. Comma-separated list of targets. Each target may be qualified with a J2EE
module name (for example, module1@server1) enabling you to deploy different
modules of the application archive on different servers. This argument defaults to the
server to which WLST is currently connected.
Example
The following example loads the BigApp application located in the c:/myapps directory, and
stores the WLSTProgress object in a user-defined variable, in this case, progress.
For more information about the WLSTProgress object, see “WLSTProgress Object” on
page C-4.
getWLDM
Command Category: Deployment Commands
Use with WLST: Online
Description
Returns the WebLogic DeploymentManager object. You can use the object methods to
configure and deploy applications. WLST must be connected to an Administration Server to run
this command. In the event of an error, the command returns a WLSTException.
Syntax
getWLDM()
Example
The following example gets the WebLogicDeploymentManager object and stores it in the wldm
variable.
wls:/mydomain/serverConfig> wldm=getWLDM()
wls:/mydomain/serverConfig> wldm.isConnected()
1
wls:/mydomain/serverConfig>
loadApplication
Command Category: Deployment Commands
Use with WLST: Online
Description
Loads an application and deployment plan into memory.
The loadApplication command returns a WLSTPlan object that you can access to make
changes to the deployment plan. For more information about the WLSTPlan object, see
“WLSTPlan Object” on page C-1. In the event of an error, the command returns a
WLSTException.
Syntax
loadApplication(appPath, [planPath], [createPlan])
Argument Definition
appPath Name of the top-level parent application directory, archive file, or root of the exploded
archive directory containing the application to be loaded.
planPath Optional. Name of the deployment plan file. The filename can be absolute or relative to
the application directory. This argument defaults to the plan/plan.xml file in the
application directory, if one exists.
createPlan Optional. Boolean value specifying whether WLST should create a plan in the
application directory if the specified plan does not exist. This argument defaults to true.
Example
The following example loads the c:/myapps/myejb.jar application using the plan file at
c:/myplans/myejb/plan.xml.
wls:/myserver/serverConfig> myPlan=loadApplication('c:/myapps/myejb.jar',
'c:/myplans/myejb/plan.xml')
Loading application from c:/myapps/myejb.jar and deployment plan from
c:/myplans/myejb/plan.xml ...
Successfully loaded the application.
wls:/myserver/serverConfig>
The previous example stores the WLSTPlan object returned in the myPlan variable. You can then
use myPlan variable to display information about the plan, such as the variables. For example:
wls:/myserver/serverConfig> myPlan.showVariables()
MyEJB jndi.ejb
MyWAR app.foo
wls:/myserver/serverConfig>
For more information about the WLSTPlan object, see “WLSTPlan Object” on page C-1.
redeploy
Command Category: Deployment Commands
Use with WLST: Online
Description
Reloads classes and redeploys a previously deployed application.
The redeploy command returns a WLSTProgress object that you can access to check the status
of the command. For more information about the WLSTProgress object, see “WLSTProgress
Object” on page C-4.
In the event of an error, the command returns a WLSTException.
For more information about redeploying applications, see “Overview of Common Deployment
Scenarios” in Deploying Application to WebLogic Server at
http://e-docs.bea.com/wls/docs90/deployment/deploy.html#overview.
Syntax
redeploy(appName, [planPath], [options])
Argument Definition
planPath Optional. Name of the deployment plan file. The filename can be absolute or relative to
the application directory. This argument defaults to the plan/plan.xml file in the
application directory, if one exists.
Example
The following example redeploys myApp application using the plan.xml file located in the
c:/myapps directory.
wls:/mydomain/serverConfig> progress=redeploy('myApp'
'c:/myapps/plan.xml')
Redeploying application 'myApp' ...
Redeployment of 'myApp' is successful
wls:/mydomain/serverConfig>
The previous example stores the WLSTProgress object returned in a user-defined variable, in this
case, progress. You can then use the progress variable to access the state of the redeploy
command. For example:
wls:/mydomain/serverConfig/Servers> progress.getState()
‘completed’
wls:/mydomain/serverConfig/Servers>
For more information about the WLSTProgress object, see “WLSTProgress Object” on
page C-4.
startApplication
Command Category: Deployment Commands
Use with WLST: Online
Description
Starts an application, making it available to users. The application must be fully configured and
available in the domain.
The startApplication command returns a WLSTProgress object that you can access to check
the status of the command. For more information about the WLSTProgress object, see
“WLSTProgress Object” on page C-4. In the event of an error, the command returns a
WLSTException.
Syntax
startApplication(appName, [options])
Argument Definition
appName Name of the application to start, as specified in the plan.xml file.
Example
The following example starts the BigApp application with the specified deployment options.
wls:/offline> progress=startApplication('BigApp', stageMode='NOSTAGE',
testMode='false')
Starting the application...
Successfully started the application.
The previous example stores the WLSTProgress object returned in a user-defined variable, in this
case, progress. You can then use the progress variable to access the state of the
startApplication command. For example:
wls:/mydomain/serverConfig/Servers> progress.getState()
‘completed’
wls:/mydomain/serverConfig/Servers>
For more information about the WLSTProgress object, see “WLSTProgress Object” on
page C-4.
stopApplication
Command Category: Deployment Commands
Use with WLST: Online
Description
Stops an application, making it unavailable to users. The application must be fully configured and
available in the domain.
The stopApplication command returns a WLSTProgress object that you can access to check
the status of the command. For more information about the WLSTProgress object, see
“WLSTProgress Object” on page C-4.
In the event of an error, the command returns a WLSTException.
Syntax
stopApplication(appName, [options])
Argument Definition
appName Name of the application to stop, as specified in the plan.xml file.
Example
The following example stops the BigApp application.
wls:/offline> progress=stopApplication('BigApp')
Stopping the application...
Successfully stopped the application.
The previous example stores the WLSTProgress object returned in a user-defined variable, in this
case, progress. You can then use the progress variable to check whether stopApplication
command is running. For example:
wls:/mydomain/serverConfig/Servers> progress.isRunning()
0
wls:/mydomain/serverConfig/Servers>
For more information about the WLSTProgress object, see “WLSTProgress Object” on
page C-4.
undeploy
Command Category: Deployment Commands
Use with WLST: Online
Description
Undeploys an application from the specified servers.
The undeploy command returns a WLSTProgress object that you can access to check the status
of the command. For more information about the WLSTProgress object, see “WLSTProgress
Object” on page C-4. In the event of an error, the command returns a WLSTException.
For more information about deploying and undeploying applications, see “Common Deployment
Operations” in Deploying Applications to WebLogic Server at
http://e-docs.bea.com/wls/docs90/deployment/intro.html.
Syntax
undeploy(appName,[targets],[options])
Argument Definition
appName Deployment name for the deployed application.
targets Optional. List of the target servers from which the application will be removed. If
not specified, defaults to all current targets.
Example
The following example removes the businessApp application from all target servers. WLST
waits 60,000 ms for the process to complete.
wls:/mydomain/serverConfig> undeploy('businessApp', timeout=60000)
Undeploying application businessApp ...
<Jul 20, 2005 9:34:15 AM EDT> <Info> <J2EE Deployment SPI> <BEA-260121>
<Initiating undeploy operation for application, businessApp [archive:
null],
to AdminServer .>
updateApplication
Command Category: Deployment Commands
Use with WLST: Online
Description
Updates an application configuration using a new deployment plan. The application must be fully
configured and available in the domain.
The updateApplication command returns a WLSTProgress object that you can access to
check the status of the command. For more information about the WLSTProgress object, see
“WLSTProgress Object” on page C-4. In the event of an error, the command returns a
WLSTException.
Syntax
updateApplication(appName, [planPath], [options])
Argument Definition
appName Name of the application, as specified in the current plan.xml file.
planPath Optional. Name of the new deployment plan file. The filename can be absolute or relative
to the application directory.
Example
The following example updates the application configuration for BigApp using the plan.xml file
located in c:/myapps/BigApp/newPlan.
wls:/offline> progress=updateApplication('BigApp',
'c:/myapps/BigApp/newPlan/plan.xml', stageMode='STAGE', testMode='false')
Updating the application...
Successfully updated the application.
The previous example stores the WLSTProgress object returned in a user-defined variable, in this
case, progress. You can then use the progress variable to access the state of the
updateApplication command. For example:
wls:/mydomain/serverConfig/Servers> progress.getState()
‘completed’
wls:/mydomain/serverConfig/Servers>
For more information about the WLSTProgress object, see “WLSTProgress Object” on
page C-4.
Diagnostics Commands
Use the WLST diagnostics commands, listed in Table A-5, to execute queries against the
diagnostic data. For more information about the WebLogic Server Diagnostic Service, see
Configuring and Using the WebLogic Diagnostic Framework at
http://e-docs.bea.com/wls/docs90/wldf_configuring/index.html.
“exportDiagnosticDataFromSe Executes a query on the server side and retrieves the Online
rver” on page A-36 exported WebLogic Diagnostic Framework (WLDF)
data.
exportDiagnosticData
Command Category: Diagnostics Commands
Use with WLST: Offline
Description
Executes a query against the specified log file. The results are saved to an XML file.
For more information about the WebLogic Server Diagnostic Service, see Configuring and Using
the WebLogic Diagnostic Framework at
http://e-docs.bea.com/wls/docs90/wldf_configuring/index.html.
Syntax
exportDiagnosticData([options])
Argument Definition
options Optional. Comma-separated list of export diagnostic options, specified as name-value
pairs. Valid options include:
• beginTimestamp—Timestamp (inclusive) of the earliest record to be added to the
result set. This option defaults to 0.
• endTimestamp—Timestamp (exclusive) of the latest record to be added to the result
set. This option defaults to Long.MAX_VALUE.
• exportFileName—Name of the file to which the data is exported. This option
defaults to export.xml.
• logicalName—Logical name of the log file being read. Valid values include:
HarvestedDataArchive, EventsDataArchive, ServerLog, DomainLog,
HTTPAccessLog, WebAppLog, ConnectorLog, and JMSMessageLog. This
option defaults to ServerLog.
• logName—Base log filename containing the log data to be exported. This option
defaults to myserver.log.
• logRotationDir—Directory containing the rotated log files. This option defaults to
“.” (current directory).
• query—Expression specifying the filter condition for the data records to be included
in the result set. This option defaults to “” (empty string), which returns all data. For
more information, see “WLDF Query Language” in Configuring and Using the
Weblogic Diagnostic Framework at
http://e-docs.bea.com/wls/docs90/wldf_configuring/appendix
_query.html.
• storeDir—Location of the diagnostic store for the server. This option defaults to
../data/store/diagnostics.
Example
The following example executes a query against the ServerLog named myserver.log and
stores the results in the file named myExport.xml.
wls:/offline/mydomain>exportDiagnosticData(logicalName='ServerLog',
logName='myserver.log', exportFileName='myExport.xml')
wls:/mydomain/serverRuntime>
exportDiagnosticDataFromServer
Command Category: Diagnostics Commands
Use with WLST: Online
Description
Executes a query on the server side and retrieves the exported WebLogic Diagnostic Framework
(WLDF) data. The results are saved to an XML file.
For more information about the WebLogic Server Diagnostic Service, see Understanding the
WebLogic Diagnostic Service at
http://e-docs.bea.com/wls/docs90/wldf_understanding/index.html.
Syntax
exportDiagnosticDataFromServer([options])
Argument Definition
Example
The following example executes a query against the HTTPAccessLog and stores the results in the
file named myExport.xml.
wls:/mydomain/serverRuntime>
exportDiagnosticDataFromServer(logicalName="HTTPAccessLog",
exportFileName="myExport.xml")
Editing Commands
Use the WLST editing commands, listed in Table A-6, to interrogate and edit configuration
beans.
Note: To edit configuration beans, you must be connected to an Administration Server, and you
must navigate to the edit tree and start an edit session, as described in “edit” on
page A-118 and “startEdit” on page A-59, respectively.
If you connect to a Managed Server, WLST functionality is limited to browsing the
configuration bean hierarchy. While you cannot use WLST to change the values of
MBeans on Managed Servers, it is possible to use the Management APIs to do so. BEA
Systems recommends that you change only the values of configuration MBeans on the
Administration Server. Changing the values of MBeans on Managed Servers can lead to
an inconsistent domain configuration.
For more information about editing configuration beans, see “Editing Configuration
MBeans” on page 4-12.
“activate” on page A-39 Activate changes saved during the current editing session Online or
but not yet deployed. Offline
“assignAll” on page A-43 Assign all applications or services to one or more Offline
destinations.
“cancelEdit” on page A-44 Cancel an edit session, release the edit lock, and discard all Online
unsaved changes. This operation can be called by any user
with administrator privileges, even if the user did not start
the edit session.
“create” on page A-45 Create a configuration bean of the specified type for the Online or
current bean. Offline
“delete” on page A-47 Delete an instance of a configuration for the current Online or
configuration bean. Offline
“get” on page A-49 Return the value of the specified attribute. Online or
Offline
“save” on page A-54 Save the edits that have been made but have not yet been Online
saved.
“set” on page A-55 Set the specified attribute value for the current Online or
configuration bean. Offline
“setOption” on page A-56 Set options related to a domain creation or update. Offline
“showChanges” on page A-58 Show the changes made to the configuration by the current Online
user during the current edit session.
“startEdit” on page A-59 Starts a configuration edit session on behalf of the currently Online
connected user.
“stopEdit” on page A-60 Stop the current edit session, release the edit lock, and Online
discard unsaved changes.
“unassign” on page A-61 Unassign applications or resources from one or more Offline
destinations.
“unassignAll” on page A-63 Unassign applications or resources from one or more Offline
destinations.
“validate” on page A-65 Validate the changes that have been made but have not yet Online
been saved.
activate
Command Category: Editing Commands
Use with WLST: Online
Description
Activates changes saved during the current editing session but not yet deployed. This command
prints a message if a server restart is required for the changes that are being activated.
The activate command returns the latest ActivationTask MBean which reflects the state of
changes that a user is currently making or has made recently. You can then invoke methods to get
information about the latest Configuration Manager activate task in progress or just completed.
In the event of an error, the command returns a WLSTException.
Syntax
activate([timeout], [block])
Argument Definition
timeout Optional. Time (in milliseconds) that WLST waits for the activation of configuration
changes to complete before canceling the operation. A value of -1 indicates that the
operation will not time out. This argument defaults to 300,000 ms (or 5 minutes).
block Optional. Boolean value specifying whether WLST should block user interaction until
the command completes. This argument defaults to false, indicating that user
interaction is not blocked. In this case, WLST returns control to the user after issuing
the command and assigns the task MBean associated with the current task to a variable
that you can use to check its status.If you are importing WLST as a Jython module, as
described in “Importing WLST as a Jython Module” on page 2-11, block is always
set to true.
Example
The following example activates the changes made during the current edit session that have been
saved to disk, but that have not yet been activated. WLST waits for 100,000 ms for the activation
to complete, and 200,000 ms before the activation is stopped.
wls:/mydomain/edit !> activate(200000, block='true')
Activating all your changes, this may take a while ...
The edit lock associated with this edit session is released once the
activation is completed.
Action completed.
wls:/mydomain/edit>
assign
Command Category: Editing Commands
Use with WLST: Offline
Description
Assigns resources to one or more destinations.
In the event of an error, the command returns a WLSTException.
Syntax
assign(sourceType, sourceName, destinationType, destinationName)
Argument Definition
sourceType Type of configuration bean to be assigned. This value can be set to one of the
following values:
• AppDeployment
• Library
• securityType (such as User)
• Server
• service (such as JDBCSystemResource)
• service.SubDeployment, where service specifies the service type of
the SubDeployment (such as JMSSystemResource.SubDeployment);
you can also specify nested subdeployments (such as
AppDeployment.SubDeployment.SubDeployment)
Guidelines for setting this value are provided below.
sourceName Name of the resource to be assigned. Multiple names can be specified, separated by
commas.
Specify subdeployments using the following format: service.subDeployment,
where service specifies the parent service and subDeployment specifies the
name of the subdeployment. For example,
myJMSResource.myQueueSubDeployment. You can also specify nested
subdeployments, such as
MedRecEAR.MedRecAppScopedJMS.MedRecJMSServer.
destinationType Type of destination. Guidelines for setting this value are provided below.
destinationName Name of the destination. Multiple names can be specified, separated by commas.
Use the following guidelines for setting the sourceType and destinationType:
– sourceType: AppDeployment
– destinationType: Target
Example
The following examples:
assignAll
Command Category: Editing Commands
Use with WLST: Offline
Description
Note: This command is deprecated for WebLogic Server 9.0. You should update your script to use
the assign command as described in “assign” on page A-40. This command will still
operate on any resources that exist for the specified sourceType.
Assigns all applications or services to one or more destinations.
Note: Note that you must assign JMS server and JMS distributed destinations using the assign
command, as described in “assign” on page A-40.
In the event of an error, the command returns a WLSTException.
Syntax
assignAll(sourceType, destinationType, destinationName)
Argument Definition
sourceType Type of applications or services to be assigned. This value can be set to
Applications or Services.
destinationName Name(s) of the destination. Multiple names can be specified, separated by commas.
Example
The following example assigns all services to the servers adminServer and cluster1.
wls:/offline/mydomain> assignAll("Services", "Target",
"adminServer,cluster1")
cancelEdit
Command Category: Editing Commands
Use with WLST: Online
Description
Cancels an edit session, releases the edit lock, and discards all unsaved changes.
The user issuing this command does not have to be the current editor; this allows an administrator
to cancel an edit session, if necessary, to enable other users to start an edit session.
In the event of an error, the command returns a WLSTException.
Syntax
cancelEdit([defaultAnswer])
Argument Definition
defaultAnswer Optional. Default response, if you would prefer not to be prompted at the command
line. Valid values are y and n. This argument defaults to null, and WLST prompts you
for a response.
Example
The following example cancels the current editing session. WLST prompts for verification before
canceling.
create
Command Category: Editing Commands
Use with WLST: Online or Offline
Description
Creates a configuration bean of the specified type for the current bean.
The create command returns a stub for the newly created configuration bean. In the event of an
error, the command returns a WLSTException.
Notes: Child types must be created under an instance of their parent type. You can only create
configuration beans that are children of the current Configuration Management Object
(cmo) type. For more information about the cmo variable, see “Changing the Current
Management Object” on page 4-3.
Because WLST offline enables you to access and update the configuration objects that
appear in the configuration files only, if you wish to view and/or change attribute values
for a configuration object that is not already persisted in the configuration files as an
XML element, you must first create the configuration object.
Please note the following when using the create command with WLST online:
z You must be connected to an Administration Server. You cannot use the create command
for runtime MBeans or when WLST is connected to a Managed Server instance.
z You must navigate to the edit configuration MBean hierarchy using the edit command
before issuing this command. See “edit” on page A-118.
z You can use the create command to create a WebLogic Server configuration MBean that is
a child of the current MBean type.
Please note the following when using the create command with WLST offline:
z When using WLST offline, the following characters are not valid in object names: period
(.), forward slash (/), or backward slash (\).
For more information about:
z Examples of creating specific types of MBean resources, for example, a JMS or JDBC
system resource, refer to the WLST sample scripts installed with your product, as
described in “WLST Sample Scripts” on page 1-3.
z MBeans, their child types, attributes, and operations, see WebLogic Server MBean
Reference at http://e-docs.bea.com/wls/docs90/wlsmbeanref/core/index.html.
Syntax
create(name, childMBeanType, [baseProviderType])
Argument Definition
name Name of the configuration bean that you are creating.
childMBeanType Type of configuration bean that you are creating. You can create instances of any type
defined in the config.xml file except custom security types. For more information
about valid configuration beans, see WebLogic Server Configuration Reference at
http://e-docs.bea.com/wls/docs90/wlsmbeanref/index.html.
baseProviderType When creating a security provider, specifies the base security provider type, for
example, AuthenticationProvider. This argument defaults to None.
Example
The following example creates a child configuration bean of type Server named newServer for
the current configuration bean, storing the stub as server1:
wls:/mydomain/edit !> server1=create('newServer','Server')
Server with name ‘newServer’ has been created successfully.
wls:/mydomain/edit !> server1.getName()
‘newServer’
wls:/mydomain/edit !>
The following example creates an authentication provider security provider called myProvider:
wls:/mydomain/edit !> cd('SecurityConfiguration/mydomain/Realms/myrealm')
wls:/mydomain/edit !>
create('myProvider','weblogic.security.providers.authentication.SQLAuthent
icator','AuthenticationProvider')
The following example creates a machine named highsec_nm and sets attributes for the
associated Node Manager.
wls:/mydomain/edit !> create('highsec_nm', 'Machine')
wls:/mydomain/edit !> cd('Machine/highsec_nm/NodeManager/highsec_nm')
wls:/mydomain/edit !> set('DebugEnabled', 'true')
wls:/mydomain/edit !> set('ListenAddress', 'innes')
wls:/mydomain/edit !> set('NMType', 'SSL')
wls:/mydomain/edit !> set('ShellCommand', '')
delete
Command Category: Editing Commands
Use with WLST: Online or Offline
Description
Deletes an instance of a configuration bean of the specified type for the current configuration
bean.
In the event of an error, the command returns a WLSTException.
Note: You can only delete configuration beans that are children of current Configuration
Management Object (cmo) type. For more information about the cmo variable, see
“Changing the Current Management Object” on page 4-3.
Syntax
delete(name, childMBeanType)
Argument Definition
childMBeanType Type of the configuration bean to be deleted. You can delete instances of any type
defined in the config.xml file. For more information about valid configuration
beans, see WebLogic Server Configuration Reference at
http://e-docs.bea.com/wls/docs90/wlsmbeanref/index.html.
Example
The following example deletes the configuration bean of type Server named newServer:
wls:/mydomain/edit !> delete('newServer','Server')
Server with name 'newServer' has been deleted successfully.
wls:/mydomain/edit !>
encrypt
Command Category: Editing Commands
Use with WLST: Online
Description
Encrypts the specified string. You can then use the encrypted string in your configuration file or
as an argument to a command.
The weblogic.security.Encrypt utility encrypts cleartext strings for use with WebLogic
Server. The utility uses the encryption service of the current directory, or the encryption service
for a specified WebLogic Server domain root directory.
Note: An encrypted string must have been encrypted by the encryption service in the WebLogic
Server domain where it will be used. If not, the server will not be able to decrypt the
string.
In the event of an error, the command returns a WLSTException.
Syntax
encrypt(obj, [domainDir])
Argument Definition
obj String that you want to encrypt.
Example
The following example encrypts the specified string using the
security/SerializedSystemIni.dat file in the specified domain directory.
wls:/mydomain/serverConfig>
es=encrypt('myPassword','c:/bea/domains/mydomain')
get
Command Category: Editing Commands
Use with WLST: Online or Offline
Description
Returns the value of the specified attribute. For more information about the MBean attributes that
can be viewed, see WebLogic Server MBean Reference at
http://e-docs.bea.com/wls/docs90/wlsmbeanref/core/index.html. In the event of an
error, the command returns a WLSTException.
Note: You can list all attributes and their current values by entering ls('a'). For more
information, see “ls” on page A-78.
Alternatively, you can use the cmo variable to perform any get method on the current
configuration bean. For example:
cmo.getListenPort()
For more information about the cmo variable, see “Changing the Current Management Object”
on page 4-3.
Syntax
get(attrName)
Argument Definition
attrName Name of the attribute to be displayed. You can specify the full pathname of the
attribute. If no pathname is specified, the attribute is displayed for the current
configuration object.
Example
The following example returns the value of the AdministrationPort for the current
configuration bean.
wls:/mydomain/serverConfig> get('AdministrationPort')
9002
getActivationTask
Command Category: Editing Commands
Use with WLST: Online
Description
Return the latest ActivationTask MBean on which a user can get status. The ActivationTask
MBean reflects the state of changes that a user is currently making or has made recently. You can
then invoke methods to get information about the latest Configuration Manager activate task in
progress or just completed. In the event of an error, the command returns a WLSTException.
Syntax
getActivationTask()
Example
The following example returns the latest ActivationTask MBean on which a user can get status
and stores it within the task variable.
wls:/mydomain/serverConfig> task=getActivationTask()
wls:/mydomain/serverConfig> task.getState()
STATE_COMMITTED
invoke
Command Category: Editing Commands
Use with WLST: Online
Description
Invokes a management operation on the current configuration bean. Typically, you use this
command to invoke operations other than the get and set operations that most WebLogic Server
configuration beans provide. The class objects are loaded through the same class loader that is
used for loading the configuration bean on which the action is invoked.
You cannot use the invoke command when WLST is connected to a Managed Server instance.
If successful, the invoke command returns the object that is returned by the operation invoked.
In the event of an error, the command returns a WLSTException.
Syntax
invoke(methodName, parameters, signatures)
Argument Definition
methodName Name of the method to be invoked.
Example
The following example invokes the lookupServer method on the current configuration bean.
wls:/mydomain/config> objs =
jarray.array([java.lang.String("oamserver")],java.lang.Object)
wls:/mydomain/edit> strs = jarray.array(["java.lang.String"],java.lang.String)
wls:/mydomain/edit> invoke('lookupServer',objs,strs)
true
wls:/mydomain/edit>
isRestartRequired
Command Category: Editing Commands
Use with WLST: Online
Description
Determines whether a server restart is required.
If you invoke this command while an edit session is in progress, the response is based on the edits
that are currently in progress. If you specify the name of an attribute, WLST indicates whether a
server restart is required for that attribute only.
In the event of an error, the command returns a WLSTException.
Syntax
isRestartRequired([attributeName])
Argument Definition
attributeName Optional. Name of a specific attribute for which you want to check if a server
restart is required.
Example
The following example specifies whether a server restart is required for all changes made during
the current WLST session.
The following attribute(s) have been changed on MBeans that require server
re-start.
MBean Changed : mydomain:Name=mydomain,Type=Domain
Attributes changed : AutoConfigurationSaveEnabled
The following example specifies whether a server restart is required if you edit the
ConsoleEnabled attribute.
loadDB
Command Category: Editing Commands
Use with WLST: Offline
Description
Loads SQL files into a database.
The loadDB command loads the SQL files from a template file. This command can only be issued
after a domain template or extension template has been loaded into memory using the
readTemplate or addTemplate command, respectively.
Before executing this command, ensure that the following conditions are true:
Syntax
loadDB(dbVersion, connectionPoolName)
Argument Definition
dbVersion Version of the database for which the SQL files are intended to be used.
connectionPoolName Name of the JDBC connection pool to be used to load SQL files.
Example
The following example loads SQL files, intended for version 4.4 of the database, using the
myPool-PointBase JDBC connection pool:
wls:/offline/mydomain> loadDB('4.4', 'myPool-PointBase')
loadProperties
Command Category: Information Commands
Use with WLST: Online and Offline
Description
Loads property values from a file and makes them available in the WLST session.
This command cannot be used when you are importing WLST as a Jython module, as described
in “Importing WLST as a Jython Module” on page 2-11.
In the event of an error, the command returns a WLSTException.
Syntax
loadProperties(fileName)
Argument Definition
Example
This example gets and sets the properties file values.
wls:/mydomain/serverConfig> loadProperties('c:/temp/myLoad.properties')
save
Command Category: Editing Commands
Use with WLST: Online
Description
Saves the edits that have been made but have not yet been saved. This command is only valid
when an edit session is in progress. For information about starting an edit session, see “startEdit”
on page A-59.
In the event of an error, the command returns a WLSTException.
Syntax
save()
Example
The following example saves the edits that have not yet been saved to disk.
wls:/mydomain/edit !> save()
Saving all your changes ...
set
Command Category: Editing Commands
Use with WLST: Online or Offline
Description
Sets the specified attribute value for the current configuration bean. For more information about
the MBean attributes that can be set, see WebLogic Server MBean Reference at
http://e-docs.bea.com/wls/docs90/wlsmbeanref/core/index.html.
z You cannot use the set command when WLST is connected to a Managed Server
instance.
z While you cannot use WLST to change the values of MBeans on Managed Servers, it is
possible to use the Management APIs to do so. BEA Systems recommends that you change
only the values of configuration MBeans on the Administration Server. Changing the
values of MBeans on Managed Servers can lead to an inconsistent domain configuration.
Alternatively, you can use the cmo variable to perform any set method on the current
configuration bean. For example:
cmo.setPassword(attributeValue)
For more information about the cmo variable, see “Changing the Current Management Object”
on page 4-3.
Syntax
set(attrName, value)
Argument Definition
attrName Name of the attribute to be set.
Example
The following example sets the ArchiveConfigurationCount attribute of DomainMBean to 10:
wls:/mydomain/serverConfig> set('ArchiveConfigurationCount',10)
setOption
Command Category: Editing Commands
Use with WLST: Offline
Description
Sets options related to a domain creation or update. In the event of an error, the command returns
a WLSTException.
Syntax
setOption(optionName, optionValue)
Argument Definition
optionName Name of the option to set.
Available options for domain creation include:
• CreateStartMenu—Boolean (string) value specifying whether to create a Start Menu
shortcut on a Windows platform. This option defaults to true.
Note: If a user with Administrator privileges installed the software and chose to create the Start
menu entries in the All Users folder, only users with Administrator privileges can create
Start menu entries in the same folder when creating a domain using the Configuration
Wizard or WLST. That is, if a user without Administrator privileges uses the
Configuration Wizard or WLST from this installation to create domains, Start menu
shortcuts to the domains are not created. In this case, the users can manually create
shortcuts in their local Start menu folder, if desired.
• JavaHome—Home directory for the JVM to be used when starting the server. This option
defaults to the Sun JDK installed with the product.
• OverwriteDomain—Boolean (string) value specifying whether to allow an existing
domain to be overwritten. This option defaults to false.
• ServerStartMode—Mode to use when starting the server for the newly created domain.
This value can be dev (development) or prod (production). This option defaults to dev.
Available options for domain updates include:
• AllowCasualUpdate—Boolean (string) value specifying whether to allow a domain to be
updated without adding an extension template. This option defaults to true.
• ReplaceDuplicates—Boolean (string) value specifying whether to keep original
configuration elements in the domain or replace the elements with corresponding ones from
an extension template when there is a conflict. This option defaults to true.
Available options for both domain creation and domain updates include:
• AppDir—Application directory to be used when a separate directory is desired for
applications, as specified by the template. This option defaults to
BEAHOME/user_projects/applications/domainname, where BEAHOME specifies
the BEA home directory and domainname specifies the name of the domain.
• AutoAdjustSubDeploymentTarget—Boolean (string) value specifying whether
WLST automatically adjusts targets for the subdeployments of AppDeployments. This
option defaults to true. To deactivate this feature, set the option to false and explicitly set
the targeting for AppDeployment subdeployments before writing or updating the domain or
domain template.
• AutoDeploy—Boolean (string) value specifying whether to activate auto deployment when
a cluster or multiple Managed Servers are created. This option defaults to true. To
deactivate this feature, set the option to false on the first line of your script.
Example
The following example sets the CreateStartMenu option to false:
wls:/offline> setOption('CreateStartMenu', 'false')
showChanges
Command Category: Editing Commands
Use with WLST: Online
Description
Shows the changes made to the configuration by the current user during the current edit session.
In the event of an error, the command returns a WLSTException.
Syntax
showChanges([onlyInMemory])
Argument Definition
onlyInMemory Optional. Boolean value specifying whether to display only the changes that have not
yet been saved. This argument defaults to false, indicating that all changes that have
been made from the start of the session are displayed.
Example
The following example shows all of the changes made by the current user to the configuration
since the start of the current edit session.
wls:/mydomain/edit !> showChanges()
Changes that are in memory and saved to disc but not yet activated are:
startEdit
Command Category: Editing Commands
Use with WLST: Online
Description
Starts a configuration edit session on behalf of the currently connected user. You must navigate
to the edit configuration MBean hierarchy using the edit command before issuing this
command. For more information, see “edit” on page A-118.
This command must be called prior to invoking any command to modify the domain
configuration.
In the event of an error, the command returns a WLSTException.
Note: WLST automatically starts an edit session if it detects that there is an edit session that is
already in progress by the same user, which may have been started via the Administration
Console or another WLST session.
Syntax
startEdit([waitTimeInMillis], [timeoutInMillis], [exclusive])
Argument Definition
waitTimeInMillis Optional. Time (in milliseconds) that WLST waits until it gets a lock, in the event that
another user has a lock. This argument defaults to 0 ms.
timeoutInMillis Optional. Timeout (in milliseconds) that WLST waits to release the edit lock. This
argument defaults to -1 ms, indicating that this edit session never expires.
exclusive Optional. Specifies whether the edit session should be an exclusive session. If set to
true, if the same owner enters the startEdit command, WLST waits until the
current edit session lock is released before starting the new edit session. The exclusive
lock times out according to the time specified in timeoutInMillis. This argument
defaults to false.
Example
The following example saves the edits that have not yet been saved to disk.
wls:/mydomain/edit> startEdit(60000, 120000)
Starting an edit session ...
Started edit session, please be sure to save and activate your changes once
you are done.
wls:/mydomain/edit !>
stopEdit
Command Category: Editing Commands
Use with WLST: Online
Description
Stops the current edit session, releases the edit lock, and discards unsaved changes.
In the event of an error, the command returns a WLSTException.
Syntax
stopEdit([defaultAnswer])
Argument Definition
defaultAnswer Optional. Default response, if you would prefer not to be prompted at the command
line. Valid values are y and n. This argument defaults to null, and WLST prompts you
for a response.
Example
The following example stops the current editing session. WLST prompts for verification before
canceling.
wls:/mydomain/edit !> stopEdit()
Sure you would like to stop your edit session? (y/n)
y
Edit session has been stopped successfully.
wls:/mydomain/edit>
unassign
Command Category: Editing Commands
Use with WLST: Offline
Description
Unassign applications or resources from one or more destinations.
In the event of an error, the command returns a WLSTException.
Syntax
unassign(sourceType, sourceName, destinationType, destinationName)
Argument Definition
sourceType Type of configuration bean to be unassigned. This value can be set to one of the
following values:
• AppDeployment
• Library
• securityType (such as User)
• Server
• service (such as JDBCSystemResource)
• service.SubDeployment, where service specifies the service type of
the SubDeployment (such as JMSSystemResource.SubDeployment);
you can also specify nested subdeployments (such as
AppDeployment.SubDeployment.SubDeployment)
destinationType Type of destination. Guidelines for setting this value are provided below.
destinationName Name of the destination. Multiple names can be specified, separated by commas.
Use the following guidelines for setting the sourceType and destinationType:
Example
The following examples:
z Unassign the servers myServer and myServer2 from the cluster myCluster.
wls:/offline/medrec> unassign("Server", "myServer,myServer2", "Cluster",
"myCluster")
unassignAll
Command Category: Editing Commands
Use with WLST: Offline
Description
Note: This command is deprecated for WebLogic Server 9.0. You should update your script to use
the unassign command as described in “unassign” on page A-61. This command will
still operate on any resources that exist for the specified sourceType.
Unassigns all applications or services from one or more destinations.
In the event of an error, the command returns a WLSTException.
Syntax
unassignAll(sourceType, destinationType, destinationName)
Argument Definition
sourceType Type of applications or services to be unassigned. This value can be set to
Applications or Services.
destinationName Name(s) of the destination. Multiple names can be specified, separated by commas.
Example
The following example unassigns all services from the servers adminServer and cluster1.
wls:/offline/medrec> unassignAll("Services", "Target",
"adminServer,cluster1")
The following services, if present, are unassigned from the specified targets:
MigratableRMIService, Shutdownclass, Startupclass, FileT3, RMCFactory,
MailSession, MessagingBridge, JMSConnectionFactory, JDBCConnectionPool,
JDBCMultipool, JDBCTxDatasource, JDBCDataSource, JDBCPoolComp,
JoltConnectionPool, WLECConnectionPool, and WTCServer.
undo
Command Category: Editing Commands
Use with WLST: Online
Description
Reverts all unsaved or unactivated edits.
You specify whether to revert all unactivated edits (including those that have been saved to disk),
or all edits made since the last save operation. This command does not release the edit session.
In the event of an error, the command returns a WLSTException.
Syntax
undo([unactivateChanges], [defaultAnswer])
Argument Definition
unactivateChanges Optional. Boolean value specifying whether to undo all unactivated changes,
including edits that have been saved to disk. This argument defaults to false,
indicating that all edits since the last save operation are reverted.
defaultAnswer Optional. Default response, if you would prefer not to be prompted at the command
line. Valid values are y and n. This argument defaults to null, and WLST prompts
you for a response.
Example
The following example reverts all changes since the last save operation. WLST prompts for
verification before reverting.
wls:/mydomain/edit !> undo()
Sure you would like to undo your changes? (y/n)
y
Discarded your in-memory changes successfully.
wls:/mydomain/edit>
The following example reverts all unactivated changes. WLST prompts for verification before
reverting.
wls:/mydomain/edit !> undo('true')
Sure you would like to undo your changes? (y/n)
y
Discarded all your changes successfully.
wls:/mydomain/edit>
validate
Command Category: Editing Commands
Use with WLST: Online
Description
Validates the changes that have been made but have not yet been saved. This command enables
you to verify that all changes are valid before saving them.
In the event of an error, the command returns a WLSTException.
Syntax
validate()
Example
The following example validates all changes that have been made but have not yet been saved.
wls:/mydomain/edit !> validate()
Validating changes ...
Validated the changes successfully
Information Commands
Use the WLST information commands, listed in Table A-7, to interrogate domains, servers, and
variables, and provide configuration bean, runtime bean, and WLST-related information.
“addListener” on page A-68 Add a JMX listener to the specified MBean. Online
“dumpStack” on page A-71 Display stack trace from the last exception that Online or
occurred while performing a WLST action, and Offline
reset the stack trace.
“dumpVariables” on page A-71 Display all variables used by WLST, including Online or
their name and value. Offline
“find” on page A-72 Find MBeans and attributes in the current Online
hierarchy.
“getMBean” on page A-74 Return the MBean by browsing to the specified Online
path.
“getMBI” on page A-75 Return the MBeanInfo for the specified Online
MBeanType or the cmo variable.
“getPath” on page A-76 Return the MBean path for the specified MBean Online
instance.
“listChildTypes” on page A-76 List all the children MBeans that can be created or Online
deleted for the cmo type.
“ls” on page A-78 List all child beans and/or attributes for the current Online or
configuration or runtime bean. Offline
“man” on page A-81 Display help from MBeanInfo for the current Online
MBean or its specified attribute.
“redirect” on page A-82 Redirect WLST output to the specified filename. Online or
Offline
“removeListener” on page A-83 Remove a listener that was previously defined. Online
“showListeners” on page A-83 Show all listeners that are currently defined. Online
“startRecording” on page A-84 Record all user interactions with WLST; useful for Online or
capturing commands to replay. Offline
“state” on page A-85 Returns a map of servers or clusters and their state Online
using Node Manager.
“storeUserConfig” on page A-87 Create a user configuration file and an associated Online
key file.
“threadDump” on page A-88 Display a thread dump for the specified server. Online or
Offline
“viewMBean” on page A-89 Display information about an MBean, such as the Online
attribute names and values, and operations.
addListener
Command Category: Information Commands
Use with WLST: Online
Description
Adds a JMX listener to the specified MBean. Any changes made to the MBean are reported to
standard out and/or are saved to the specified configuration file.
In the event of an error, the command returns a WLSTException.
Syntax
addListener(mbean, [attributeNames], [logFile], [listenerName])
Argument Definition
attributeNames Optional. Comma-separated list of all attribute names on which you would like to add
a JMX listener. This argument defaults to null, and adds a JMX listener for all attributes.
logFile Optional. Name and location of the log file to which you want to write listener
information.This argument defaults to standard out.
listenerName Optional. Name of the JMX listener. This argument defaults to a WLST-generated
name.
Example
The following example defines a JMX listener on the cmo MBean for the Notes and
ArchiveConfigurationCount attributes. The listener is named domain-listener and is
stored in ./listeners/domain.log.
wls:/mydomain/serverConfig> addListener(cmo,
"Notes,ArchiveConfigurationCount","./listeners/domain.log","domain-listene
r")
configToScript
Command Category: Information Commands
Use with WLST: Online or Offline
Converts an existing server configuration (config directory) to an executable WLST script. You
can use the resulting script to re-create the resources on other servers.
Before running the generated script, you should update the properties file to specify values that
are appropriate for your environments. When you run the generated script:
z If a server is currently running, WLST will try to connect using the values in the properties
file and then run the script commands to create the server resources.
z If no server is currently running, WLST will start a server with the values in the properties
file, run the script commands to create the server resources, and shutdown the server. This
may cause you to exit from the WLST shell.
The configToScript command creates a user configuration file and an associated key file to
store encrypted attributes. The user configuration file contains the encrypted information. The
key file contains a secret key that is used to encrypt and decrypt the encrypted information.
In the event of an error, the command returns a WLSTException.
Syntax
configToScript([configPath], [pyPath], [overwrite], [propertiesFile],
[createDeploymentScript])
Argument Definition
configPath Optional. Path to the config directory that contains the configuration that you
want to convert. This argument defaults to./config.
overwrite Optional. Boolean value specifying whether the script file should be overwritten
if it already exists. This argument defaults to true, indicating that the script file
is overwritten.
propertiesFile Optional. Path to the directory in which you want WLST to write the properties
files. This argument defaults to the pathname specified for the scriptPath
argument.
createDeploymentSc Optional. Boolean value specifying whether WLST creates a script that performs
ript deployments only. This argument defaults to false, indicating that a deployment
script is not created.
Example
The following example converts the configuration to a WLST script config.py. By default, the
configuration file is loaded from ./config, the script file is saved to .config/config.py, and
the properties files is saved to .config/config.py.properties.
wls:/offline> configToScript()
configToScript is loading configuration from
c:\bea\user_projects\domains\wls\config\config.xml ...
Completed configuration load, now converting resources to wlst script...
configToScript completed successfully
The WLST script is written to c:\bea\user_projects\domains\wls\config\config.py
and the properties file associated with this script is written to
c:\bea\user_projects\domains\wls\config\config.py.properties
wls:/offline>
The following example converts server resources configured in the file
c:\bea\user_projects\domains\mydomain\config directory to a WLST script
c:\bea\myscripts\config.py.
wls:/offline> configToScript('c:/bea/user_projects/domains/mydomain',
'c:/bea/myscripts')
configToScript is loading configuration from
c:\bea\user_projects\domains\mydomain\config\config.xml ...
Completed configuration load, now converting resources to wlst script...
configToScript completed successfully
The WLST script is written to c:\bea\myscripts\config.py
and the properties file associated with this script is written to
c:\bea\mydomain\config.py.properties
wls:/offline>
dumpStack
Command Category: Information Commands
Use with WLST: Online or Offline
Description
Displays the stack trace from the last exception that occurred while performing a WLST action,
and resets the stack trace.
If successful, the dumpstack command returns the Throwable object. In the event of an error, the
command returns a WLSTException.
Syntax
dumpStack()
Example
This example displays the stack trace.
wls:/myserver/serverConfig> dumpStack()
com.bea.plateng.domain.script.jython.WLSTException:
java.lang.reflect.Invocation TargetException
...
dumpVariables
Command Category: Information Commands
Use with WLST: Online or Offline
Description
Displays all the variables used by WLST, including their name and value. In the event of an error,
the command returns a WLSTException.
Syntax
dumpVariables()
Example
This example displays all the current variables and their values.
wls:/mydomain/serverConfig> dumpVariables()
adminHome weblogic.rmi.internal.BasicRemoteRef - hostID: '-1
108080150904263937S:localhost:[7001,8001,-1,-1,-1,-1,-1]:mydomain:AdminSer
ver', oid: '259', channel: 'null'
cmgr
[MBeanServerInvocationHandler]com.bea:Name=ConfigurationManager,Type=weblo
gic.management.mbeanservers.edit.ConfigurationManagerMBean
cmo
[MBeanServerInvocationHandler]com.bea:Name=mydomain,Type=Domain
connected true
domainName mydomain
...
wls:/mydomain/serverConfig>
find
Command Category: Information Commands
Use with WLST: Online
Description
Finds MBeans and attributes in the current hierarchy.
WLST returns the pathname to the MBean that stores the attribute and/or attribute type, and its
value. If searchInstancesOnly is set to false, this command also searches the MBeanType
paths that are not instantiated in the server, but that can be created. In the event of an error, the
command returns a WLSTException.
Syntax
find([name], [type], [searchInstancesOnly])
Argument Definition
searchInstancesOnly Optional. Boolean value specifying whether to search registered instances only
or to also search MBeanTypes paths that are not instantiated in the server, but
that can be created. This argument defaults to true, indicating only the
registered instances will be searched.
Example
The following example searches for an attribute named javaCompiler in the current
configuration hierarchy.
wls:/mydomain/serverConfig> find(name = 'JavaCompiler')
Finding 'JavaCompiler' in all registered MBean instances ...
/Servers/AdminServer JavaCompilerPreClassPath null
/Servers/AdminServer JavaCompiler java
/Servers/AdminServer JavaCompilerPostClassPath null
wls:/mydomain/serverConfig>
The following example searches for an attribute of type JMSRuntime in the current configuration
hierarchy.
wls:/mydomain/serverRuntime> find(type='JMSRuntime')
Finding MBean of type 'JMSRuntime' in all the instances ...
/JMSRuntime/AdminServer.jms
wls:/mydomain/serverRuntime>
The following example searches for an attribute named execute in the current configuration
hierarchy. The searchInstancesOnly argument is set to false, indicating to also search
MBeanTypes that are not instantiated in the server.
wls:/mydomain/serverConfig> find(name='execute',
searchInstancesOnly='false')
Finding 'execute' in all registered MBean instances ...
/Servers/AdminServer ExecuteQueues
[Ljavax.management.ObjectName;@1aa7dbc
/Servers/AdminSever Use81StyleExecuteQueues
false
Now finding 'execute' in all MBean Types that can be instantiated ...
/Servers ExecuteQueues
/Servers Use81StyleExecuteQueues
wls:/mydomain/serverConfig>
getConfigManager
Command Category: Editing Commands
Use with WLST: Online
Description
Returns the latest ConfigurationManager MBean which manages the change process. You can
then invoke methods to manage configuration changes across a domain. In the event of an error,
the command returns a WLSTException.
Syntax
getConfigManager()
Example
The following example returns the latest ConfigurationManagerBean MBean and stores it
within the task variable.
wls:/mydomain/serverConfig> cm=getConfigManager()
wls:/mydomain/serverConfig> cm=getType()
'weblogic.management.mbeanservers.edit.ConfigurationManagerMBean'
getMBean
Command Category: Information Commands
Use with WLST: Online
Description
Returns the MBean by browsing to the specified path. In the event of an error, the command
returns a WLSTException.
Note: No exception is thrown if the MBean is not found.
Syntax
getMBean(mbeanPath)
Argument Definition
mbeanPath Path name to the MBean in the current hierarchy.
Example
The following example returns the MBean specified by the path.
getMBI
Command Category: Information Commands
Use with WLST: Online
Description
Returns the MBeanInfo for the specified MBeanType or the cmo variable. In the event of an error,
the command returns a WLSTException.
Syntax
getMBI([mbeanType])
Argument Definition
mbeanType Optional. MBeanType for which the MBeanInfo is displayed.
Example
The following example gets the MBeanInfo for the specified MBeanType and stores it in the
variable svrMbi.
wls:/mydomain/serverConfig>
svrMbi=getMBI('weblogic.management.configuration.ServerMBean')
getPath
Command Category: Information Commands
Use with WLST: Online
Description
Returns the MBean path for the specified MBean instance or ObjectName for the MBean in the
current tree. In the event of an error, the command returns a WLSTException.
Syntax
getPath(mbean)
Argument Definition
mbean MBean instance or ObjectName for the MBean in the current tree for which you want
to return the MBean path.
Example
The following example returns the MBean specified by the path.
listChildTypes
Command Category: Information Commands
Use with WLST: Online
Description
Lists all the child MBeans that can be created or deleted for the cmo. The cmo variable specifies
the configuration bean instance to which you last navigated using WLST. For more information about
the cmo variable, see “Changing the Current Management Object” on page 4-3.
In the event of an error, the command returns a WLSTException.
Syntax
listChildTypes([parent])
Argument Definition
parent Optional. Parent type for which you want the children types listed.
Example
The following example lists the children MBeans that can be created or deleted for the cmo type.
wls:/mydomain/serverConfig> listChildTypes()
AppDeployments
BridgeDestinations
CachingRealms
Clusters
...
wls:/mydomain/serverConfig>
lookup
Command Category: Information Commands
Use with WLST: Online
Description
Looks up the specified MBean. The MBean must be a child of the current MBean. In the event
of an error, the command returns a WLSTException.
Syntax
lookup(name, [childMBeanType])
Argument Definition
name Name of the MBean that you want to lookup.
childMBeanType Optional. The type of the MBean that you want to lookup.
Example
The following example looks up the specified server, myserver, and stores the returned stub in
the sbean variable.
wls:/mydomain/serverConfig> sbean=lookup('myserver','Server')
wls:/mydomain/serverConfig> sbean.getType()
‘Server’
wls:/mydomain/serverConfig>
ls
Command Category: Information Commands
Use with WLST: Online or Offline
Description
Lists all the child beans and/or attributes for the current configuration or runtime bean.
You can optionally control the output by specifying an argument. If no argument is specified, the
command lists all child beans and attributes in the domain. The output is returned as a string.
Note: Because WLST offline enables you to access and update the configuration objects that
appear in the configuration files only, if you wish to view and/or change attribute values
for a configuration object that is not already persisted in the configuration files as an
XML element, you must first create the configuration object.
In the event of an error, the command returns a WLSTException.
Table A-8 describes the property information that appears in the left-hand column of the ls
command output.
Note: The property information is based on the MBeanInfo; it does not reflect user permissions.
r Readable property.
x Executable operation.
Syntax
ls( ['a' | 'c' | 'o' | mbeanPath], [returnMap] [returnType])
Argument Definition
a Optional. Displays all the attribute names and values for the current configuration or
runtime bean. If the attribute is encrypted, WLST displays six asterisks (******).
c Optional. Displays all the child beans that are contained in the current configuration or
runtime bean. This argument is the default.
o Optional. This argument is only applicable when you are online (that is, WLST is
connected to a running server). Displays all operations that can be invoked on the
current runtime MBean. Operations are not shown for configuration MBeans.
mbeanPath Optional. Path name to the MBean in the current hierarchy for which you want to list
all child beans and attributes.
returnMap Optional. Boolean value specifying whether to return a map containing the return
values. If specified with the c argument, WLST returns a list of objects that contain all
the children and referral MBean names. If specified with the a argument, WLST returns
a HashMap of attribute name-value pairs. This argument defaults to false, indicating
that no map is returned; in this case, WLST returns a String.
returnType Optional. Controls the output returned in the map. This argument can be set to a, c, or
o, and is only valid if returnMap is set to true. This argument defaults to c.
Example
The following example displays all the child configuration beans, and attribute names and values
for the examples domain, which has been loaded into memory, in WLST offline mode:
wls:/offline/mydomain > ls()
dr-- AppDeployments
dr-- BridgeDestinations
dr-- Clusters
dr-- DeploymentConfiguration
dr-- Deployments
dr-- EmbeddedLDAP
dr-- ErrorHandlings
dr-- FileStores
dr-- JDBCDataSourceFactories
dr-- JDBCStores
dr-- JDBCSystemResources
dr-- JMSBridgeDestinations
dr-- JMSInteropModules
dr-- JMSServers
dr-- JMSSystemResources
dr-- JMX
...
wls:/offline/examples>
The following example displays all the attribute names and values in DomainMBean:
wls:/mydomain/serverConfig> ls('a')
-r-- AdminServerName AdminServer
-r-- AdministrationMBeanAuditingEnabled false
-r-- AdministrationPort 9002
-r-- AdministrationPortEnabled false
-r-- AdministrationProtocol t3s
-r-- ArchiveConfigurationCount 0
-r-- ClusterConstraintsEnabled false
-r-- ConfigBackupEnabled false
-r-- ConfigurationAuditType none
-r-- ConfigurationVersion 9.0.0.0
-r-- ConsoleEnabled true
-r-- LastModificationTime 0
-r-- Name basicWLSDomain
-r-- Notes null
-r-- Parent null
-r-- ProductionModeEnabled false
-r-- RootDirectory .
The following example displays all the child beans and attribute names and values in Servers
MBean:
wls:/mydomain/serverConfig> ls('Servers')
dr-- AdminServer
The following example displays the attribute names and values for the specified MBean path and
returns the information in a map:
wls:/mydomain/serverConfig> svrAttrList = ls('edit:/Servers/myserver',
returnMap='true', returnType='a')
man
Command Category: Information Commands
Use with WLST: Online
Description
Displays help from MBeanInfo for the current MBean or its specified attribute. In the event of an
error, the command returns a WLSTException.
Syntax
man([attrName])
Argument Definition
attrName Optional. MBean attribute name for which you would like to display help. If not
specified, WLST displays helps for the current MBean.
Example
The following example displays help from MBeanInfo for the ServerMBean bean.
wls:/mydomain/serverConfig> man('Servers')
dynamic : true
creator : createServer
destroyer : destroyServer
redirect
Command Category: Information Commands
Use with WLST: Online or Offline
Description
Redirects WLST output to the specified filename.
In the event of an error, the command returns a WLSTException.
Syntax
redirect(outputFile, [toStdOut])
Argument Definition
outputFile Name of the file to which you want to record the WLST commands. The filename can
be absolute or relative to the directory from which you enter the command.
toStdOut Optional. Boolean value specifying whether the output should be sent to stdout. This
argument defaults to true, indicating that the output will be sent to stdout.
Example
The following example begins redirects WLST output to the logs/wlst.log file in the current
directory:
wls:/mydomain/serverConfig> redirect('./logs/wlst.log')
removeListener
Command Category: Information Commands
Use with WLST: Online
Description
Removes a listener that was previously defined. If you do not specify an argument, WLST
removes all listeners defined for all MBeans. For information about setting a listener, see
“addListener” on page A-68.
In the event of an error, the command returns a WLSTException.
Syntax
removeListener([mbean], [listenerName])
Argument Definition
mbean Optional. Name of the MBean or MBean object for which you want to remove the
previously defined listeners.
Example
The following example removes the listener named mylistener.
wls:/mydomain/serverConfig> removeListener(listenerName="mylistener")
showListeners
Command Category: Information Commands
Use with WLST: Online
Description
Shows all listeners that are currently defined. For information about setting a listener, see
“addListener” on page A-68.
In the event of an error, the command returns a WLSTException.
Syntax
showListeners()
Example
The following example shows all listeners that are currently defined.
wls:/mydomain/serverConfig> showListeners()
startRecording
Command Category: Information Commands
Use with WLST: Online or Offline
Description
Records all user interactions with WLST. This command is useful for capturing commands for
replay.
In the event of an error, the command returns a WLSTException.
This command cannot be used when you are importing WLST as a Jython module, as described
in “Importing WLST as a Jython Module” on page 2-11.
Syntax
startRecording(recordFile, [recordAll])
Argument Definition
recordFile Name of the file to which you want to record the WLST commands. The filename can
be absolute or relative to the directory from which you invoked WLST.
recordAll Optional. Boolean value specifying whether to capture all user interactions in the file.
This argument defaults to false, indicating that only WLST commands are captured,
and not WLST command output.
Example
The following example begins recording WLST commands in the record.py file:
wls:/mydomain/serverConfig> startRecording('c:/myScripts/record.py')
Starting recording to c:/myScripts/record.py
wls:/mydomain/serverConfig>
state
Command Category: Information Commands
Use with WLST: Online
Description
Using Node Manager, returns a map of servers or clusters and their state. Node Manager must be
running.
For more information about server states, see “Understanding Server Life Cycle” in Managing
Server Startup and Shutdown at
http://e-docs.bea.com/wls/docs90/server_start/server_life.html.
Syntax
state(name, [type])
Argument Definition
name Name of the server or cluster for which you want to retrieve the current state.
type Optional. Type, Server or Cluster. This argument defaults to Server. When
returning the state of a cluster, you must set this argument explicitly to Cluster, or
the command will fail.
Example
The following example returns the state of the Managed Server, managed1.
wls:/mydomain/serverConfig> state('managed1','Server')
Current state of "managed1": SUSPENDED
wls:/mydomain/serverConfig>
wls:/mydomain/serverConfig> state('mycluster','Cluster')
There are 3 server(s) in cluster: mycluster
stopRecording
Command Category: Information Commands
Use with WLST: Online or Offline
Description
Stops recording WLST commands. For information about starting a recording, see
“startRecording” on page A-84.
In the event of an error, the command returns a WLSTException.
Syntax
stopRecording()
Example
The following example stops recording WLST commands.
wls:/mydomain/serverConfig> stopRecording()
Stopping recording to c:\myScripts\record.py
wls:/mydomain/serverConfig>
stopRedirect
Command Category: Information Commands
Use with WLST: Online or Offline
Description
Stops the redirection of WLST output to a file, if redirection is in progress.
In the event of an error, the command returns a WLSTException.
Syntax
stopRedirect()
Example
The following example stops the redirection of WLST output to a file:
wls:/mydomain/serverConfig> stopRedirect()
WLST output will not be redirected to myfile.txt any more
storeUserConfig
Command Category: Information Commands
Use with WLST: Online
Description
Creates a user configuration file and an associated key file. The user configuration file contains
an encrypted username and password. The key file contains a secret key that is used to encrypt
and decrypt the username and password.
Only the key file that originally encrypted the username and password can be used to decrypt the
values. If you lose the key file, you must create a new user configuration and key file pair.
In the event of an error, the command returns a WLSTException.
Syntax
storeUserConfig(userConfigFile, userKeyFile, [nm])
Argument Definition
userConfigFile Name of the file to store the user configuration. The filename can be absolute or
relative to the directory from which you enter the command.
userKeyFile Name of the file to store the key information that is associated with the user
configuration file that you specify. The pathname can be absolute or relative to the
directory from which you enter the command.
nm Optional. Boolean value specifying whether to store the username and password for
Node Manager or WebLogic Server. If set to true, the Node Manager username and
password is stored. This argument default to false.
Example
The following example creates and stores a user configuration file and key file in the specified
locations.
wls:/mydomain/serverConfig>
storeUserConfig('c:/myFiles/myuserconfigfile.secure',
'c:/myFiles/myuserkeyfile.secure')
Creating the key file can reduce the security of your system if it is not
kept in a secured location after it is created. Do you want to create the
key file? y or n
y
The username and password that were used for this current WLS connection are
stored in c:/myFiles/mysuserconfigfile.secure and
c:/myFiles/myuserkeyfile.secure
wls:/mydomain/serverConfig>
threadDump
Command Category: Information Commands
Use with WLST: Online or Offline
Description
Displays a thread dump for the specified server. In the event of an error, the command returns a
WLSTException.
Syntax
threadDump([writeToFile], [fileName], [serverName])
Argument Definition
writeToFile Optional. Boolean value specifying whether to save the output to a file. This argument
defaults to true, indicating that output is saved to a file.
fileName Optional. Name of the file to which the output is written. The filename can be absolute
or relative to the directory where WLST is running. This argument defaults to
Thread_Dump_serverName file, where serverName indicates the name of the
server. This argument is valid only if writeToFile is set to true.
serverName Optional. Server name for which the thread dump is requested. This argument defaults
to the server to which WLST is connected.
If you are connected to an Administration Server, you can display a thread dump for the
Administration Server and any Managed Server that is running in the domain. If you are
connected to a Managed Server, you can only display a thread dump for that Managed
Server.
Example
The following example displays the thread dump for the current server and saves the output to
the Thread_Dump_serverName file.
wls:/mydomain/serverConfig> threadDump()
The following example displays the thread dump for the server managedServer. The
information is not saved to a file.
wls:/mydomain/serverConfig> threadDump(writeToFile='false',
serverName='managedServer')
viewMBean
Command Category: Information Commands
Use with WLST: Online
Description
Displays information about an MBean, such as the attribute names and values, and operations. In
the event of an error, the command returns a WLSTException.
Syntax
viewMBean(mbean)
Argument Definition
mbean MBean for which you want to display information.
Example
The following example displays information about the current MBean, cmo.
wls:/mydomain/serverConfig> cmo.getType()
‘Domain’
wls:/mydomain/serverConfig> viewMBean(cmo)
Attribute Names and Values
--------------------------
XMLEntityCaches null
Targets javax.management.ObjectName[com.bea
:Name=MedRecJMSServer,Type=JMSServer,
com.bea:Name=WSStoreForwardInternalJMSServerMedRecServer,Type=JMSServer,
com.bea:Name=MedRecWseeJMSServer,Type=JMSServer,
com.bea:Name=PhysWSEEJMSServer,Type=JMSServer,
com.bea:Name=MedRecSAFAgent,Type=SAFAgent,
com.bea:Name=AdminServer,Type=Server]
RootDirectory .
EmbeddedLDAP
com.bea:Name=OOTB_medrec,Type=EmbeddedLDAP
RemoteSAFContexts null
Libraries javax.management.ObjectName[com.bea
...
wls:/mydomain/serverConfig>
writeIniFile
Command Category: Editing Commands
Use with WLST: Online
Description
Converts WLST definitions and method declarations to a Python (.py) file to enable advanced
users to import them as a Jython module. After importing, the definitions and method declarations
are available to other Jython modules and can be accessed directly using Jython syntax. For more
information, see “Importing WLST as a Jython Module” on page 2-11.
In the event of an error, the command returns a WLSTException.
Syntax
writeIniFile(filePath)
Argument Definition
filePath Full pathname to the file that you want to save the converted information.
Example
The following example converts WLST to a Python file named wl.py.
wls:/offline> writeIniFile("wl.py")
The Ini file is successfully written to wl.py
wls:/offline>
“migrate” on page A-92 Migrate services to a target server within a cluster. Online
“resume” on page A-93 Resume a server instance that is suspended or in ADMIN state. Online
“shutdown” on page A-94 Gracefully shut down a running server instance or cluster. Online
“start” on page A-96 Start a Managed Server instance or a cluster using Node Online
Manager.
migrate
Command Category: Life Cycle Commands
Use with WLST: Online
Description
Migrates the specified services (JTA, JMS, or Server) to a targeted server within a cluster. In the
event of an error, the command returns a WLSTException.
Syntax
migrate(sname, destinationName, [sourceDown], [destinationDown],
[migrationType])
Argument Definition
sname Name of the server from which the services should be migrated.
destinationName Name of the machine or server to which you want to migrate the services.
sourceDown Optional. Boolean value specifying whether the source server is down. This argument
defaults to true, indicating that the source server is not running.
When migrating JTA services, the sourceDown argument is ignored, if specified, and
defaults to true. The source server must be down in order for the migration of JTA
services to succeed.
destinationDown Optional. Boolean value specifying whether the destination server is down. This
argument defaults to false, indicating that the destination server is running.
If the destination is not running, and you do not set this argument to true, WLST
returns a MigrationException.
When migrating a JMS service to a non-running server instance, the server instance
will activate the JMS service upon the next startup. When migrating the JTA
Transaction Recovery Service to a non-running server instance, the target server
instance will assume recovery services when it is started.
migrationType Optional. Type of service(s) that you want to migrate. Valid values include:
• jta—Migrate JTA services only.
• server—Migrate Server services only.
• all—Migrate all JTA and JMS services.
This argument defaults to all.
Example
The following example migrates all JMS and JTA services on server1 to the server server2.
The boolean arguments specify that the source server is down and the destination server is
running.
wls:/mydomain/edit !> migrate('server1','server2', 'true', 'false', 'all')
Migrating all JMS and JTA services from 'server1' to destination ‘server2’
...
wls:/mydomain/edit !>
The following example migrates all Server services on server1 to the server server2. The
boolean arguments specify that the source server is down and the destination server is running.
wls:/mydomain/edit !> migrate('server1','server2', 'true', 'false',
'Server')
Migrating singleton server services from 'server1' to machine 'server2'...
wls:/mydomain/edit !>
resume
Command Category: Life Cycle Commands
Use with WLST: Online
Description
Resumes a server instance that is suspended or in ADMIN state. This command moves a server to
the RUNNING state. For more information about server states, see “Understanding Server Life
Cycle” in Managing Server Startup and Shutdown at
http://e-docs.bea.com/wls/docs90/server_start/server_life.html.
Syntax
resume([sname], [block])
Argument Definition
sname Name of the server to resume. This argument defaults to the server to which WLST is
currently connected.
Example
The following example resumes a Managed Server instance.
wls:/mydomain/serverConfig> resume('managed1', block='true')
Server 'managed1' resumed successfully.
wls:/mydomain/serverConfig>
shutdown
Command Category: Life Cycle Commands
Use with WLST: Online
Description
Gracefully shuts down a running server instance or a cluster. The shutdown command waits for
all the in-process work to be completed before shutting down the server or cluster.
You shut down a server to which WLST is connected by entering the shutdown command
without any arguments.
When connected to a Managed Server instance, you only use the shutdown command to shut
down the Managed Server instance to which WLST is connected; you cannot shut down another
server while connected to a Managed Server instance.
WLST uses Node Manager to shut down a Managed Server. When shutting down a Managed
Server, Node Manager must be running.
In the event of an error, the command returns a WLSTException.
Syntax
shutdown([name], [entityType], [ignoreSessions], [timeOut], [force],
[block])
Argument Definition
name Optional. Name of the server or cluster to shutdown. This argument defaults to the
server to which WLST is currently connected.
entityType Optional. Type, Server or Cluster. This argument defaults to Server. When
shutting down a cluster, you must set this argument explicitly to Cluster, or the
command will fail.
ignoreSessions Optional. Boolean value specifying whether WLST should drop all HTTP sessions
immediately or wait for HTTP sessions to complete or timeout while shutting down.
This argument defaults to false, indicating that all HTTP sessions must complete
or timeout.
timeOut Optional. Time (in seconds) that WLST waits for subsystems to complete in-process
work and suspend themselves before shutting down the server. This argument
defaults to 0 seconds, indicating that there is no timeout.
force Optional. Boolean value specifying whether WLST should terminate a server
instance or a cluster without waiting for the active sessions to complete. This
argument defaults to false, indicating that all active sessions must complete before
shutdown.
block Optional. Boolean value specifying whether WLST should block user interaction
until the server is shutdown. This argument defaults to false, indicating that user
interaction is not blocked. In this case, WLST returns control to the user after issuing
the command and assigns the task MBean associated with the current task to a
variable that you can use to check its status. If you are importing WLST as a Jython
module, as described in “Importing WLST as a Jython Module” on page 2-11,
block is always set to true.
Example
The following example instructs WLST to shutdown the server to which you are connected:
wls:/mydomain/serverConfig> shutdown()
Shutting down the admin server that you are currently connected to .......
Disconnected from weblogic server: AdminServer
The following example instructs WLST to wait 1000 seconds for HTTP sessions to complete or
timeout (at 1000 ms) before shutting down myserver:
wls:/mydomain/serverConfig> shutdown('myserver','Server','false',1000,
block='false')
The following example instructs WLST to drop all HTTP sessions immediately while connected
to a Managed Server instance:
wls:/mydomain/serverConfig> shutdown('MServer1','Server','true',1200)
Shutting down a managed server that you are connected to ...
Disconnected from weblogic server: MServer1
start
Command Category: Life Cycle Commands
Use with WLST: Online
Description
Starts a Managed Server instance or a cluster using Node Manager. WLST must be connected to
the Administration Server and Node Manager must be running.
For more information about WLST commands used to connect to and use Node Manager, see
“Node Manager Commands” on page A-100.
In the event of an error, the command returns a WLSTException.
Syntax
start(name, [type], [url], [block])
Argument Definition
name Name of the Managed Server or cluster to start.
type Optional. Type, Server or Cluster. This argument defaults to Server. When
starting a cluster, you must set this argument explicitly to Cluster, or the
command will fail.
url Optional. Listen address and listen port of the server instance, specified using the
following format: [protocol://]listen-address:listen-port. If not
specified, this argument defaults to t3://localhost:7001.
block Optional. Boolean value specifying whether WLST should block user interaction
until the server or cluster is started. This argument defaults to false, indicating
that user interaction is not blocked. In this case, WLST returns control to the user
after issuing the command and assigns the task MBean associated with the current
task to a variable that you can use to check its status. If you are importing WLST
as a Jython module, as described in “Importing WLST as a Jython Module” on
page 2-11, block is always set to true.
Example
The following example instructs Node Manager to start a Managed Server instance; the listen
address is localhost and listen port is 8801. WLST returns control to the user after issuing this
command, as block is set to false.
wls:/mydomain/serverConfig> start('myserver', 'Server', block='false')
Starting server myserver ...
Server with name myserver started successfully.
wls:/mydomain/serverConfig>
The following example instructs Node Manager to start a cluster. WLST block user interaction
until the cluster is started, as block defaults to true.
wls:/mydomain/serverConfig> start('mycluster', 'Cluster')
Starting the following servers in Cluster, mycluster: MS1, MS2, MS3...
......................................................................
All servers in the cluster mycluster are started successfully.
wls:/mydomain/serverConfig>
startServer
Command Category: Life Cycle Commands
Use with WLST: Online or Offline
Description
Starts the Administration Server. In the event of an error, the command returns a
WLSTException.
Syntax
startServer([adminServerName], [domainName], [url], [username], [password],
[domainDir], [block], [timeout], [serverLog], [systemProperties],
[jvmArgs])
Argument Definition
adminServerName Optional. Name of the Administration Server to start. This argument defaults to
myserver.
domainName Optional. Name of the domain to which the Administration Server belongs. This
argument defaults to mydomain.
username Optional. Username use to connect WLST to the server. This argument defaults to
weblogic.
password Optional. Password used to connect WLST to the server. This argument defaults to
weblogic.
domainDir Optional. Domain directory in which the Administration Server is being started. This
argument defaults to the current directory in which WLST is running.
block Optional. Boolean value specifying whether WLST blocks user interaction until the
server is started. When block is set to false, WLST returns control to the user after
issuing the command and assigns the task MBean associated with the current task to
a variable that you can use to check its status. This argument defaults to true,
indicating that user interaction is blocked. If you are importing WLST as a Jython
module, as described in “Importing WLST as a Jython Module” on page 2-11, block
is always set to true.
serverLog Optional. Location of the server log file. This argument defaults to stdout.
systemProperties Optional. System properties to pass to the server process. System properties should be
specified as comma-seperated name-value pairs, and the name-value pairs should be
separated by equals sign (=).
jvmArgs Optional. JVM arguments to pass to the server process. Multiple arguments can be
specified, separated by commas.
Example
The following example starts the Administration Server named demoServer in the demoDomain.
By default, useNM is set to true, and, therefore, Node Manager must be running.
wls:/offline> startServer('demoServer','demoDomain','t3://localhost:8001',
'myweblogic','wlstdomain','c:/mydomains/wlst','false', 60000,
jvmArgs='-XX:MaxPermSize=75m, -Xmx512m, -XX:+UseParallelGC')
wls:/offline>
suspend
Command Category: Life Cycle Commands
Use with WLST: Online
Description
Suspends a running server. This command moves a server from the RUNNING state to the ADMIN
state. For more information about server states, see “Understanding Server Life Cycle” in
Managing Server Startup and Shutdown at
http://e-docs.bea.com/wls/docs90/server_start/server_life.html.
Syntax
suspend([sname], [ignoreSessions], [timeOut], [force], [block])
Argument Definition
sname Optional. Name of the server to suspend. The argument defaults to the server to which
WLST is currently connected.
ignoreSessions Optional. Boolean value specifying whether WLST should drop all HTTP sessions
immediately or wait for HTTP sessions to complete or time out while suspending. This
argument defaults to false, indicating that HTTP sessions must complete or time out.
timeOut Optional. Time (in seconds) the WLST waits for the server to complete in-process work
before suspending the server. This argument defaults to 0 seconds, indicating that there
is no timeout.
force Optional. Boolean value specifying whether WLST should suspend the server without
waiting for active sessions to complete. This argument defaults to false, indicating
that all active sessions must complete before suspending the server.
block Optional. Boolean value specifying whether WLST blocks user interaction until the
server is started. This argument defaults to false, indicating that user interaction is not
blocked. In this case, WLST returns control to the user after issuing the command and
assigns the task MBean associated with the current task to a variable that you can use to
check its status. If you are importing WLST as a Jython module, as described in
“Importing WLST as a Jython Module” on page 2-11, block is always set to true.
Example
The following example suspends a Managed Server instance:
wls:/mydomain/serverConfig> suspend('managed1')
Server 'managed1' suspended successfully.
wls:/mydomain/serverConfig>
Note: Node Manager must be running before you can execute the commands within this
category. For all commands except for nm and nmconnect, WLST must be connected to
a running Node Manager.
“nm” on page A-101 Determine whether WLST is connected to Node Manager. Online
“nmConnect” on page A-102 Connect WLST to Node Manager to establish a session. Online or
Offline
“nmDisconnect” on page A-104 Disconnect WLST from a Node Manager session. Online
“nmEnroll” on page A-104 Enroll the machine on which WLST is currently running. Online
“nmKill” on page A-106 Kill the specified server instance that was started with Online
Node Manager.
“nmServerLog” on page A-107 Return the server output log of the server that was started Online
with Node Manager.
“nmServerStatus” on page A-108 Return the status of the server that was started with Node Online
Manager.
“nmStart” on page A-109 Start a server in the current domain using Node Manager. Online
“nmVersion” on page A-110 Return the Node Manager server version. Online
nm
Command Category: Node Manager Commands
Use with WLST: Online
Description
Determines whether WLST is connected to Node Manager. Returns true or false and prints a
descriptive message. Node Manager must be running before you can execute this command.
In the event of an error, the command returns a WLSTException.
Syntax
nm()
Example
The following example indicates that WLST is currently connected to Node Manager that is
monitoring mydomain.
wls:/mydomain/serverConfig> nm()
Currently connected to Node Manager that is monitoring the domain "mydomain"
wls:/mydomain/serverConfig>
The following example indicates that WLST is not currently connected to Node Manager.
wls:/mydomain/serverConfig> nm()
Not connected to any Node Manager
wls:/mydomain/serverConfig>
nmConnect
Command Category: Node Manager Commands
Use with WLST: Online or Offline
Description
Connects WLST to Node Manager to establish a session. After connecting to Node Manager, you
can invoke any Node Manager commands via WLST. Node Manager must be running before you
can execute this command.
Once connected, the WLST prompt displays as follows, where domainName indicates the name
of the domain that is being managed: wls:/nm/domainName>. If you then connect WLST to a
WebLogic Server instance, the prompt is changed to reflect the WebLogic Server instance. You
can use the nm command to determine whether WLST is connected to Node Manager, as
described in “nm” on page A-101.
In the event of an error, the command returns a WLSTException.
Syntax
nmConnect([username], [password], [host], [port], [domainName], [domainDir]
[nmType])
Argument Definition
username Username of the operator who is connecting WLST to Node Manager. The username
defaults to weblogic.
Note: When running a server in production mode, you must specify the username and
password explicitly on the command line to ensure that the appropriate
username and password are used when connecting to Node Manager.
password Password of the operator who is connecting WLST to Node Manager. The password
defaults to weblogic.
Note: When running a server in production mode, you must specify the username and
password explicitly on the command line to ensure that the appropriate
username and password are used when connecting to Node Manager.
host Optional. Host name of Node Manager. This argument defaults to localhost.
port Optional. Port number of Node Manager. This argument defaults to a value that is
based on the Node Manager server type, as follows:
• For plain type, defaults to 5556
• For rsh type, defaults to 514
• For ssh type, defaults to 22
• For ssl type, defaults to 5556
domainName Optional. Name of the domain that you want to manage. This argument defaults to
mydomain.
domainDir Optional. Path of the domain directory to which you want to save the Node Manager
secret file (nm_password.properties) and SerializedSystemIni.dat file.
This argument defaults to the directory in which WLST was started.
Example
The following example connects WLST to Node Manager to monitor the oamdomain domain
using the default host and port numbers and plain Node Manager type.
wls:/myserver/serverConfig> nmConnect('weblogic', 'weblogic', 'localhost',
'5555', 'oamdomain', 'c:/bea/user_projects/domains/oamdomain','plain')
Connecting to Node Manager Server ...
Successfully connected to Node Manager.
wls:/nm/oamdomain>
nmDisconnect
Command Category: Node Manager Commands
Use with WLST: Online
Description
Disconnects WLST from a Node Manager session. WLST must be connected to Node Manager
to run this command.
In the event of an error, the command returns a WLSTException.
Syntax
nmDisconnect()
Example
The following example disconnects WLST from a Node Manager session.
wls:/nm/oamdomain> nmDisconnect()
Successfully disconnected from Node Manager
wls:/myserver/serverConfig>
nmEnroll
Command Category: Node Manager Commands
Use with WLST: Online
Description
Enrolls the machine on which WLST is currently running. WLST must be connected to an
Administration Server to run this command; WLST does not need to be connected to Node
Manager.
This command downloads the following files from the Administration Server:
z SerializedSystemIni.dat file
This command also updates the nodemanager.domains file under the
WL_HOME/common/nodemanager directory with the domain information, where WL_HOME refers
to the top-level installation directory for WebLogic Server.
You must run this command once per domain per machine unless that domain shares the root
directory of the Administration Server.
If the machine is already enrolled when you run this command, the Node Manager secret file
(nm_password.properties) is refreshed with the latest information from the Administration
Server.
In the event of an error, the command returns a WLSTException.
Syntax
nmEnroll([domainDir], [nmHome])
Argument Definition
domainDir Optional. Path of the domain directory to which you want to save the Node Manager
secret file (nm_password.properties) and SerializedSystemIni.dat file.
This argument defaults to the directory in which WLST was started.
nmHome Optional. Path to the Node Manager home. The nodemanager.domains file,
containing the domain information, is written to this directory. This argument defaults
to WL_HOME/common/nodemanager, where WL_HOME refers to the top-level
installation directory for WebLogic Server.
Example
The following example enrolls the current machine with Node Manager and saves the Node
Manager secret file (nm_password properties) and SerializedSystemIni.dat file to
c:/bea/mydomain/common/nodemanager/nm_password.properties. The
nodemanager.domains file is written to WL_HOME/common/nodemanager by default.
wls:/mydomain/serverConfig> nmEnroll('c:/bea/mydomain/common/nodemanager')
Enrolling this machine with the domain directory at
c:\bea\mydomain\common\nodemanager....
Successfully enrolled this machine with the domain directory at
C:\bea\mydomain\common\nodemanager
wls:/mydomain/serverConfig>
nmKill
Command Category: Node Manager Commands
Use with WLST: Online
Description
Kills the specified server instance that was started with Node Manager.
If you do not specify a server name using the serverName argument, the argument defaults to
myServer, which must match your server name or the command will fail.
If you attempt to kill a server instance that was not started using Node Manager, the command
displays an error. WLST must be connected to Node Manager to run this command.
In the event of an error, the command returns a WLSTException.
Syntax
nmKill([serverName])
Argument Definition
serverName Optional. Name of the server to be killed. This argument defaults to myserver.
Example
The following example kills the server named oamserver.
wls:/nm/oamdomain> nmKill('oamserver')
Killing server ‘oamserver’ ...
Server oamServer killed successfully.
wls:/nm/oamdomain>
nmLog
Command Category: Node Manager Commands
Use with WLST: Online
Description
Returns the Node Manager log. WLST must be connected to Node Manager to run this command.
In the event of an error, the command returns a WLSTException.
Syntax
nmLog([writer])
Argument Definition
writer Optional. java.io.Writer object to which you want to stream the log output.
This argument defaults to the WLST writer stream.
Example
The following example displays the Node Manager log.
wls:/nm/oamdomain> nmLog()
Successfully retrieved the Node Manager log and written.
wls:/nm/oamdomain>
nmServerLog
Command Category: Node Manager Commands
Use with WLST: Online
Description
Returns the server output log of the server that was started with Node Manager. WLST must be
connected to Node Manager to run this command.
In the event of an error, the command returns a WLSTException.
Syntax
nmServerLog([serverName], [writer])
Argument Definition
serverName Optional. Name of the server for which you want to display the server output log. This
argument defaults to myserver.
writer Optional. java.io.Writer object to which you want to stream the log output.
This argument defaults to the WLSTInterpreter standard out, if not specified.
Example
The following example displays the server output log for the oamserver server and writes the
log output to myWriter.
wls:/nm/oamdomain> nmServerLog('oamserver',myWriter)
Successfully retrieved the server log and written.
wls:/nm/oamdomain>
nmServerStatus
Command Category: Node Manager Commands
Use with WLST: Online
Description
Returns the status of the server that was started with Node Manager. WLST must be connected
to Node Manager to run this command.
In the event of an error, the command returns a WLSTException.
Syntax
nmServerStatus([serverName])
Argument Definition
serverName Optional. Name of the server for which you want to display the status. This argument
defaults to myserver.
Example
The following example kills the server named oamserver.
wls:/nm/oamdomain> nmServerStatus('oamserver')
RUNNING
wls:/nm/oamdomain>
nmStart
Command Category: Node Manager Commands
Use with WLST: Online
Description
Starts a server in the current domain using Node Manager. WLST must be connected to Node
Manager to run this command.
In the event of an error, the command returns a WLSTException.
Syntax
nmStart([serverName], [domainDir], [props], [writer])
Argument Definition
serverName Optional. Name of the server to be started.
domainDir Optional. Domain directory of the server to be started. This argument defaults to the
current directory in which WLST is running.
Example
The following example starts the managed1 server in the current domain using Node Manager.
wls:/nm/mydomain> nmStart("managed1")
Starting server managed1 ...
Server managed1 started successfully
wls:/nm/mydomain>
The following example starts the Administration Server in the specified domain using Node
Manager. In this example, the prps variable stores the system property settings and is passed to
the command using the props argument.
wls:/nm/mydomain> prps = makePropertiesObject("weblogic.ListenPort=8001")
wls:/nm/mydomain> nmStart("AdminServer",props=prps)
Starting server AdminServer...
Server AdminServer started successfully
wls:/nm/mydomain>
nmVersion
Command Category: Node Manager Commands
Use with WLST: Online
Description
Returns the Node Manager server version. WLST must be connected to Node Manager to run this
command.
In the event of an error, the command returns a WLSTException.
Syntax
nmVersion()
Example
The following example displays the Node Manager server version.
wls:/nm/oamdomain> nmVersion()
The Node Manager version that you are currently connected to is 9.0.0.0
wls:/nm/oamdomain>
startNodeManager
Command Category: Node Manager Commands
Use with WLST: Online or Offline
Description
Starts Node Manager at the default port (5556).
Note: The WebLogic Server custom installation process optionally installs and starts Node
Manager as a Windows service on Windows systems. For more information, see “About
Node Manager Installation as a Windows Service” in BEA Products Installation Guide
at
http://e-docs.bea.com/common/docs90/install/prepare.html#node_manag
er. In this case, you do not need to start the Node Manager manually.
If Node Manager is already running when you invoke the startNodeManager command, the
following message is displayed:
A Node Manager has already been started.
Cannot start another Node Manager process via WLST
Syntax
startNodeManager([verbose], [nmProperties])
Example
Argument Definition
verbose Optional. Boolean value specifying whether WLST starts Node Manager in verbose
mode. This argument defaults to false, disabling verbose mode.
Tree Commands
Use the WLST tree commands, listed in Table A-11, to navigate among MBean hierarchies.
“config” on page A-113 Navigate to the last MBean to which you navigated in the Online
configuration MBean hierarchy or to the root of the
hierarchy, DomainMBean.
Note: This command is deprecated for WebLogic Server
9.0. You should update your script to use the
serverConfig command as described in
“serverConfig” on page A-121.
“custom” on page A-115 Navigate to the root of custom MBeans that are registered in Online
the server.
“domainConfig” on page A-116 Navigate to the last MBean to which you navigated in the Online
domain configuration hierarchy or to the root of the
hierarchy, DomainMBean.
“domainRuntime” on Navigate to the last MBean to which you navigated in the Online
page A-117 domain runtime hierarchy or to the root of the hierarchy,
DomainRuntimeMBean.
“edit” on page A-118 Navigate to the last MBean to which you navigated in the edit Online
configuration MBean hierarchy or to the root of the
hierarchy, DomainMBean.
“jndi” on page A-119 Navigates to the JNDI tree for the server to which WLST is Online
currently connected.
“runtime” on page A-120 Navigate to the last MBean to which you navigated in the Online
runtime hierarchy or the root of all runtime objects,
DomainRuntimeMBean.
“serverConfig” on page A-121 Navigate to the last MBean to which you navigated in the Online
configuration MBean hierarchy or to the root of the
hierarchy, DomainMBean.
“serverRuntime” on page A-121 Navigate to the last MBean to which you navigated in the Online
runtime MBean hierarchy or to the root of the hierarchy,
ServerRuntimeMBean.
config
Command Category: Tree Commands
Use with WLST: Online
Description
Note: This command is deprecated for WebLogic Server 9.0. You should update your scripts
to use the serverConfig command, as described in “serverConfig” on page A-121.
Navigates to the last MBean to which you navigated in the configuration MBean hierarchy or to
the root of the hierarchy, DomainMBean. For more information, see “Navigating Among MBean
Hierarchies” on page 4-9.
In the event of an error, the command returns a WLSTException.
Syntax
config()
Example
The following example illustrates how to navigate from the runtime MBean hierarchy to the
configuration MBean hierarchy on an Administration Server instance:
wls:/mydomain/runtime> config()
Location changed to config tree (deprecated). This is a writeable tree with
DomainMBean as the root.
For more help, use help('config')
wls:/mydomain/config> ls()
dr-- Applications
dr-- BridgeDestinations
dr-- Clusters
dr-- DeploymentConfiguration
dr-- Deployments
dr-- DomainLogFilters
dr-- EmbeddedLDAP
dr-- JDBCConnectionPools
dr-- JDBCDataSourceFactories
dr-- JDBCDataSources
dr-- JDBCMultiPools
dr-- JDBCTxDataSources
dr-- JMSBridgeDestinations
dr-- JMSConnectionFactories
dr-- JMSDestinationKeys
dr-- JMSDestinations
dr-- JMSDistributedQueueMembers
dr-- JMSDistributedQueues
dr-- JMSDistributedTopicMembers
dr-- JMSDistributedTopics
dr-- JMSFileStores
dr-- JMSJDBCStores
...
wls:/mydomain/config>
custom
Command Category: Tree Commands
Use with WLST: Online
Description
Navigates to the root of custom MBeans that are registered in the server. WLST navigates,
interrogates, and edits custom MBeans as it does domain MBeans; however, custom MBeans
cannot use the cmo variable because a stub is not available.
Note: When navigating to the custom tree, WLST queries all MBeans in the compatibility
MBean server, the runtime MBean server, and potentially the JVM platform MBean
server to locate the custom MBeans. Depending on the number of MBeans in the current
domain, this process make take a few minutes, and WLST may not return a prompt right
away.
The custom command is available when WLST is connected to an Administration Server
instance or a Managed Server instance. When connected to a WebLogic Integration or WebLogic
Portal server, WLST can interact with all the WebLogic Integration or WebLogic Portal server
MBeans.
For more information about custom MBeans, see “Non-WebLogic Server MBeans” in
Programming WebLogic Management Services with JMX at
http://e-docs.bea.com/wls/docs81/jmx/overview.html#non_weblogic_server_mbe
ans.
Syntax
custom()
Example
The following example navigates from the configuration MBean hierarchy to the custom MBean
hierarchy on a Administration Server instance.
wls:/mydomain/serverConfig> custom()
Location changed to custom tree. This is a writeable tree with No root. For
more help, use help('custom')
wls:/mydomain/custom>
domainConfig
Command Category: Tree Commands
Use with WLST: Online
Description
Navigates to the last MBean to which you navigated in the domain Configuration hierarchy or to
the root of the hierarchy, DomainMBean. This read-only hierarchy stores the configuration
MBeans that represent your current domain.
In the event of an error, the command returns a WLSTException.
Syntax
domainConfig()
Example
The following example navigates from the configuration MBean hierarchy to the domain
Configuration hierarchy on an Administration Server instance.
wls:/mydomain/serverConfig> domainConfig()
Location changed to domainConfig tree. This is a read-only tree with
DomainMBean as the root.
For more help, use help('domainConfig')
wls:/mydomain/domainConfig> ls()
dr-- AppDeployments
dr-- BridgeDestinations
dr-- Clusters
dr-- DeploymentConfiguration
dr-- Deployments
dr-- EmbeddedLDAP
dr-- ErrorHandlings
dr-- FileStores
dr-- JDBCDataSourceFactories
dr-- JDBCStores
dr-- JDBCSystemResources
dr-- JMSBridgeDestinations
dr-- JMSInteropModules
dr-- JMSServers
dr-- JMSSystemResources
...
wls:/mydomain/domainConfig>
domainRuntime
Command Category: Tree Commands
Use with WLST: Online
Description
Navigates to the last MBean to which you navigated in the domain Runtime hierarchy or to the
root of the hierarchy, DomainRuntimeMBean. This read-only hierarchy stores the runtime
MBeans that represent your current domain.
In the event of an error, the command returns a WLSTException.
Syntax
domainRuntime()
Example
The following example navigates from the configuration MBean hierarchy to the domain
Runtime hierarchy on an Administration Server instance.
wls:/mydomain/serverConfig> domainRuntime()
wls:/mydomain/domainRuntime> ls()
dr-- AppRuntimeStateRuntime
dr-- DeployerRuntime
dr-- DomainServices
dr-- LogRuntime
dr-- MessageDrivenControlEJBRuntime
dr-- MigratableServiceCoordinatorRuntime
dr-- SNMPAgentRuntime
dr-- ServerLifeCycleRuntimes
dr-- ServerRuntimes
dr-- ServerServices
edit
Command Category: Tree Commands
Use with WLST: Online
Description
Navigates to the last MBean to which you navigated in the edit configuration MBean hierarchy
or to the root of the hierarchy, DomainMBean. This writeable hierarchy stores all of the
configuration MBeans that represent your current domain.
Note: To edit configuration beans, you must be connected to an Administration Server. If you
connect to a Managed Server, WLST functionality is limited to browsing the
configuration bean hierarchy. While you cannot use WLST to change the values of
MBeans on Managed Servers, it is possible to use the Management APIs to do so. BEA
Systems recommends that you change only the values of configuration MBeans on the
Administration Server. Changing the values of MBeans on Managed Servers can lead to
an inconsistent domain configuration.
For more information about editing configuration beans, see “Editing Configuration
MBeans” on page 4-12.
In the event of an error, the command returns a WLSTException.
Syntax
edit()
Example
The following example illustrates how to navigate from the server configuration MBean
hierarchy to the editable copy of the domain configuration MBean hierarchy, in an
Administration Server instance.
wls:/myserver/serverConfig> edit()
Location changed to edit tree. This is a writeable tree with DomainMBean as
the root.
For more help, use help('edit')
wls:/myserver/edit !> ls()
dr-- AppDeployments
dr-- BridgeDestinations
dr-- Clusters
dr-- DeploymentConfiguration
dr-- Deployments
dr-- EmbeddedLDAP
...
wls:/myserver/edit !>
jndi
Command Category: Tree Commands
Use with WLST: Online
Description
Navigates to the JNDI tree for the server to which WLST is currently connected. This read-only
tree holds all the elements that are currently bound in JNDI.
In the event of an error, the command returns a WLSTException.
Syntax
jndi()
Example
The following example navigates from the runtime MBean hierarchy to the Domain JNDI tree on
an Administration Server instance.
wls:/myserver/runtime> jndi()
Location changed to jndi tree. This is a read-only tree with No root. For
more help, use help('jndi')
wls:/myserver/jndi> ls()
dr-- ejb
dr-- javax
dr-- jms
dr-- weblogic
...
runtime
Command Category: Tree Commands
Use with WLST: Online
Description
Note: This command is deprecated for WebLogic Server 9.0. You should update your scripts
to use the serverRuntime command, as described in “serverRuntime” on page A-121.
Navigates to the last MBean to which you navigated in the runtime hierarchy or the root of all
runtime objects, DomainRuntimeMBean. When connected to a Managed Server instance, the root
of runtime MBeans is ServerRuntimeMBean.
In the event of an error, the command returns a WLSTException.
For more information, see “Browsing Runtime MBeans” on page 4-6.
Syntax
runtime()
Example
The following example navigates from the configuration MBean hierarchy to the runtime MBean
hierarchy on a Managed Server instance.
wls:/mydomain/serverConfig> runtime()
Location changed to runtime tree (deprecated). This is a read-only tree with
serverConfig
Command Category: Tree Commands
Use with WLST: Online
Description
Navigates to the last MBean to which you navigated in the configuration MBean hierarchy or to
the root of the hierarchy, DomainMBean.
This read-only hierarchy stores the configuration MBeans that represent the server to which
WLST is currently connected. The MBean attribute values include any command-line overrides
that a user specified while starting the server.
In the event of an error, the command returns a WLSTException.
For more information, see “Navigating Among MBean Hierarchies” on page 4-9.
Syntax
serverConfig()
Example
The following example navigates from the domain runtime MBean hierarchy to the configuration
MBean hierarchy on an Administration Server instance.
wls:/mydomain/domainRuntime> serverConfig()
wls:/mydomain/serverConfig>
serverRuntime
Command Category: Tree Commands
Use with WLST: Online
Description
Navigates to the last MBean to which you navigated in the runtime MBean hierarchy or to the
root of the hierarchy, ServerRuntimeMBean. This read-only hierarchy stores the runtime
MBeans that represent the server to which WLST is currently connected.
Syntax
serverRuntime()
Example
The following example navigates from the configuration MBean hierarchy to the runtime MBean
hierarchy on an Administration Server instance.
wls:/mydomain/serverConfig> serverRuntime()
Location changed to serverRuntime tree. This is a read-only tree with
ServerRuntimeMBean as the root.
For more help, use help('serverRuntime')
wls:/mydomain/serverRuntime>
“activate” on page A-39 Activate changes saved during the current editing session Online
but not yet deployed.
“addListener” on page A-68 Add a JMX listener to the specified MBean. Online
“addTemplate” on page A-8 Extend the current domain using an application or service Offline
extension template.
“assignAll” on page A-43 Assign all applications or services to one or more Offline
destinations.
“cancelEdit” on page A-44 Cancel an edit session, release the edit lock, and discard all Online
unsaved changes. This operation can be called by any user
with administrator privileges, even if the user did not start
the edit session.
“cd” on page A-3 Navigate the hierarchy of configuration or runtime beans. Online or
Offline
“config” on page A-113 Navigate to the last MBean to which you navigated in the Online
Administration or local configuration MBean hierarchy or
to the root of the hierarchy, DomainMBean.
Note: This command is deprecated for WebLogic Server
9.0. You should update your script to use the
serverConfig command as described in
“serverConfig” on page A-121.
“create” on page A-45 Create a configuration bean of the specified type for the Online or
current bean. Offline
“currentTree” on page A-4 Return the current location in the hierarchy. Online
“custom” on page A-115 Navigate to the root of custom MBeans that are registered Online
in the server.
“delete” on page A-47 Delete an instance of a configuration bean of the specified Online or
type for the current configuration bean. Offline
“disconnect” on page A-13 Disconnect WLST from a WebLogic Server instance. Online
“domainConfig” on page A-116 Navigate to the last MBean to which you navigated in the Online
domain configuration hierarchy or to the root of the
hierarchy, DomainMBean.
“domainRuntime” on page A-117 Navigate to the last MBean to which you navigated in the Online
domain runtime hierarchy or to the root of the hierarchy,
DomainRuntimeMBean.
“dumpStack” on page A-71 Display stack trace from the last exception that occurred Online or
while performing a WLST action, and reset the stack trace. Offline
“dumpVariables” on page A-71 Display all variables used by WLST, including their name Online or
and value. Offline
“edit” on page A-118 Navigate to the last MBean to which you navigated in the Online
configuration edit MBean hierarchy or to the root of the
hierarchy, DomainMBean.
“exit” on page A-14 Exit WLST from the user session and close the scripting Online or
shell. Offline
“exportDiagnosticDataFromServer Executes a query on the server side and retrieves the Online
” on page A-36 exported WebLogic Diagnostic Framework (WLDF) data.
“find” on page A-72 Find MBeans and attributes in the current hierarchy. Online
“get” on page A-49 Return the value of the specified attribute. Online or
Offline
“getActivationTask” on page A-50 Return the latest ActivationTask MBean on which a Online
user can get status.
“getMBean” on page A-74 Return the MBean by browsing to the specified path. Online
“getMBI” on page A-75 Return the MBeanInfo for the specified MBeanType or Online
the cmo variable.
“getPath” on page A-76 Return the MBean path for the specified MBean instance. Online
“jndi” on page A-119 Navigates to the JNDI tree for the server to which WLST Online
is currently connected.
“listChildTypes” on page A-76 List all the children MBeans that can be created or deleted Online
for the cmo.
“loadApplication” on page A-27 Load an application and deployment plan into memory. Online or
Offline
“loadProperties” on page A-53 Load property values from a file. Online and
Offline
“ls” on page A-78 List all child beans and/or attributes for the current Online or
configuration or runtime bean. Offline
“man” on page A-81 Display help from MBeanInfo for the current MBean or Online
its specified attribute.
“migrate” on page A-92 Migrate services to a target server within a cluster. Online
“nm” on page A-101 Determine whether WLST is connected to Node Manager. Online
“nmConnect” on page A-102 Connect WLST to Node Manager to establish a session. Online
“nmDisconnect” on page A-104 Disconnect WLST from a Node Manager session. Online
“nmEnroll” on page A-104 Enroll the machine on which WLST is currently running. Online
“nmKill” on page A-106 Kill the specified server instance that was started with Online
Node Manager.
“nmServerLog” on page A-107 Return the server output log of the server that was started Online
with Node Manager.
“nmServerStatus” on page A-108 Return the status of the server that was started with Node Online
Manager.
“nmStart” on page A-109 Start a server in the current domain using Node Manager. Online
“nmVersion” on page A-110 Return the Node Manager server version. Online
“prompt” on page A-5 Toggle the display of path information at the prompt. Online or
Offline
“pwd” on page A-6 Display the current location in the configuration or runtime Online or
bean hierarchy. Offline
“readTemplate” on page A-16 Open an existing domain template for domain creation. Offline
“redeploy” on page A-28 Reload classes and redeploy a previously deployed Online
application.
“redirect” on page A-82 Redirect WLST output to the specified filename. Online or
Offline
“removeListener” on page A-83 Remove a listener that was previously defined. Online
“resume” on page A-93 Resume a server instance that is suspended or in ADMIN Online
state.
“runtime” on page A-120 Navigate to the last MBean to which you navigated in the Online
Runtime hierarchy or the root of all runtime objects,
DomainRuntimeMBean.
“save” on page A-54 Save the edits that have been made but have not yet been Online
saved.
“serverConfig” on page A-121 Navigate to the last MBean to which you navigated in the Online
configuration MBean hierarchy or to the root of the
hierarchy, DomainMBean.
“serverRuntime” on page A-121 Navigate to the last MBean to which you navigated in the Online
runtime MBean hierarchy or to the root of the hierarchy,
ServerRuntimeMBean.
“set” on page A-55 Set the specified attribute value for the current Online or
configuration bean. Offline
“setOption” on page A-56 Set options related to a domain creation or update Offline
“showChanges” on page A-58 Show the changes made by the current user during the Online
current edit session.
“showListeners” on page A-83 Show all listeners that are currently defined. Online
“shutdown” on page A-94 Gracefully shut down a running server instance or cluster. Online
“start” on page A-96 Start a Managed Server instance or a cluster using Node Online
Manager.
“startEdit” on page A-59 Start a configuration edit session on behalf of the currently Online
connected user.
“startRecording” on page A-84 Record all user interactions with WLST; useful for Online or
capturing commands to replay. Offline
“state” on page A-85 Returns a map of servers or clusters and their state using Online
Node Manager.
“stopEdit” on page A-60 Stop the current edit session, release the edit lock, and Online
discard unsaved changes.
“stopRedirect” on page A-86 Stop the redirection of WLST output to a file. Online or
Offline
“storeUserConfig” on page A-87 Create a user configuration file and an associated key file. Online
“threadDump” on page A-88 Display a thread dump for the specified server. Online or
Offline
“undeploy” on page A-31 Undeploy an application from the specified servers. Online
“updateDomain” on page A-17 Update and save the current domain. Offline
“unassign” on page A-61 Unassign applications or services from one or more Offline
destinations.
“unassignAll” on page A-63 Unassign all applications or services from one or more Offline
destinations.
“validate” on page A-65 Validate the changes that have been made but have not yet Online
been saved.
“viewMBean” on page A-89 Display information about an MBean, such as the attribute Online
names and values, and operations.
“writeDomain” on page A-18 Write the domain configuration information to the Offline
specified directory.
“writeIniFile” on page A-90 Convert WLST definitions and method declarations to a Online or
Python (.py) file. Offline
“writeTemplate” on page A-19 Writes the domain configuration information to the Offline
specified domain template.
“activate” on page A-39 Activate changes saved during the current editing session but not yet
deployed.
“cancelEdit” on page A-44 Cancel an edit session, release the edit lock, and discard all unsaved
changes. This operation can be called by any user with administrator
privileges, even if the user did not start the edit session.
“config” on page A-113 Navigate to the last MBean to which you navigated in the configuration
MBean hierarchy or to the root of all configuration beans,
DomainMBean.
“create” on page A-45 Create a configuration bean of the specified type for the current bean.
“custom” on page A-115 Navigate to the root of custom MBeans that are registered in the server.
“delete” on page A-47 Delete an instance of a configuration bean of the specified type for the
current configuration bean.
“domainConfig” on page A-116 Navigate to the last MBean to which you navigated in the domain
configuration hierarchy or to the root of the hierarchy, DomainMBean.
“domainRuntime” on page A-117 Navigate to the last MBean to which you navigated in the domain runtime
hierarchy or to the root of the hierarchy, DomainRuntimeMBean.
“dumpStack” on page A-71 Display stack trace from the last exception that occurred, and reset the
trace.
“dumpVariables” on page A-71 Display all variables used by WLST, including their name and value.
“edit” on page A-118 Navigate to the last MBean to which you navigated in the configuration
edit MBean hierarchy or to the root of the hierarchy, DomainMBean.
“exit” on page A-14 Exit WLST from the interactive session and close the scripting shell.
“exportDiagnosticDataFromServer Execute a query on the server side and retrieves the exported WebLogic
” on page A-36 Diagnostic Framework (WLDF) data.
“find” on page A-72 Find MBeans and attributes in the current hierarchy.
“getActivationTask” on page A-50 Return the latest ActivationTask MBean on which a user can get
status.
“getMBean” on page A-74 Return the MBean by browsing to the specified path.
“getMBI” on page A-75 Return the MBeanInfo for the specified MBeanType or the cmo
variable.
“getPath” on page A-76 Return the MBean path for the specified MBean instance.
“invoke” on page A-50 Invoke a management operation on the current configuration bean.
“jndi” on page A-119 Navigates to the JNDI tree for the server to which WLST is currently
connected.
“listChildTypes” on page A-76 List all the children MBeans that can be created or deleted for the cmo.
“loadApplication” on page A-27 Load an application and deployment plan into memory.
“ls” on page A-78 List all child beans and/or attributes for the current configuration or
runtime bean.
“man” on page A-81 Display help from MBeanInfo for the current MBean or its specified
attribute.
“nmEnroll” on page A-104 Enroll the machine on which WLST is currently running.
“nmKill” on page A-106 Kill the specified server instance that was started with Node Manager.
“nmServerLog” on page A-107 Return the server output log of the server that was started with Node
Manager.
“nmServerStatus” on page A-108 Return the status of the server that was started with Node Manager.
“nmStart” on page A-109 Start a server in the current domain using Node Manager.
“prompt” on page A-5 Toggle the display of path information at the prompt.
“pwd” on page A-6 Display the current location in the configuration or runtime bean
hierarchy.
“redeploy” on page A-28 Reload classes and redeploy a previously deployed application.
“resume” on page A-93 Resume a server instance that is suspended or in ADMIN state.
“runtime” on page A-120 Navigate to the last MBean to which you navigated in the Runtime
hierarchy or the root of all runtime objects, DomainRuntimeMBean.
Note: This command is deprecated for WebLogic Server 9.0. You
should update your scripts to use the serverRuntime
command, as described in “serverRuntime” on page A-121.
“save” on page A-54 Save the edits that have been made but have not yet been saved.
“serverConfig” on page A-121 Navigate to the last MBean to which you navigated in the configuration
MBean hierarchy or to the root of the hierarchy, DomainMBean.
“serverRuntime” on page A-121 Navigate to the last MBean to which you navigated in the runtime MBean
hierarchy or to the root of the hierarchy, ServerRuntimeMBean.
“set” on page A-55 Set the specified attribute value for the current configuration bean.
“showChanges” on page A-58 Show the changes made by the current user during the current edit
session.
“showListeners” on page A-83 Show all listeners that are currently defined.
“shutdown” on page A-94 Gracefully shut down a running server instance or cluster.
“start” on page A-96 Start a Managed Server instance or a cluster using Node Manager.
“startEdit” on page A-59 Start a configuration edit session on behalf of the currently connected
user.
“startRecording” on page A-84 Record all user interactions with WLST; useful for capturing commands
to replay.
“state” on page A-85 Returns a map of servers or clusters and their state using Node Manager
“stopEdit” on page A-60 Stop the current edit session, release the edit lock, and discard unsaved
changes.
“storeUserConfig” on page A-87 Create a user configuration file and an associated key file.
“threadDump” on page A-88 Display a thread dump for the specified server.
“updateApplication” on page A-33 Update an application configuration using a new deployment plan.
“validate” on page A-65 Validate the changes that have been made but have not yet been saved.
“viewMBean” on page A-89 Display information about an MBean, such as the attribute names and
values, and operations.
“writeIniFile” on page A-90 Convert WLST definitions and method declarations to a Python (.py)
file.
“addTemplate” on page A-8 Extend the current domain using an application or service extension
template.
“assignAll” on page A-43 Assign all applications or services to one or more destinations.
“create” on page A-45 Create a configuration bean of the specified type for the current bean.
“delete” on page A-47 Delete an instance of a configuration bean of the specified type for the
current configuration bean.
“dumpStack” on page A-71 Display stack trace from the last exception that occurred while
performing a WLST action, and reset the stack trace.
“dumpVariables” on page A-71 Display all variables used by WLST, including their name and value.
“exit” on page A-14 Exit WLST from the interactive session and close the scripting shell.
“ls” on page A-78 List all child beans and/or attributes for the current configuration or
runtime bean.
“prompt” on page A-5 Toggle the display of path information at the prompt.
“pwd” on page A-6 Display the current location in the configuration or runtime bean
hierarchy.
“readTemplate” on page A-16 Open an existing domain template for domain creation.
“set” on page A-55 Set the specified attribute value for the current configuration bean.
“startRecording” on page A-84 Record all user interactions with WLST; useful for capturing commands
to replay.
“threadDump” on page A-88 Display a thread dump for the specified server.
“unassign” on page A-61 Unassign applications or services from one or more destinations.
“unassignAll” on page A-63 Unassign all applications or services from one or more destinations.
“writeDomain” on page A-18 Write the domain configuration information to the specified directory.
“writeIniFile” on page A-90 Convert WLST definitions and method declarations to a Python (.py)
file.
“writeTemplate” on page A-19 Writes the domain configuration information to the specified domain
template.
WLSTPlan Object
The WLSTPlan object enables you to make changes to an application deployment plan after
loading an application using the loadApplication command, as described in “loadApplication”
on page A-27.
The following table describes the WLSTPlan object methods that you can use to operate on the
deployment plan.
WLSTProgress Object
The WLSTProgress object enables you to check the status of an executed deployment command.
The WLSTProgress object is returned by the following commands:
The following table describes the WLSTProgress object methods that you can use to check the
status of the current deployment action.
FAQs: WLST
General WLST
z What is the relationship between WLST and the existing WebLogic Server command-line
utilities, such as wlconfig and weblogic.Deployer?
z When would I choose to use WLST over the other command-line utilities or the
Administration Console?
z Is there a GUI that displays the MBeans in a Swing format, similar to wlshell?
Jython Support
z If I have SSL or the administration port enabled for my server, how do I connect using
WLST?
z In the event of an error, can you control whether WLST continues or exits?
z Why do I have to specify ( and ) after each command, and enclose arguments in single- or
double-quotes?
z Can I start a server, deploy applications, and then shutdown the server using WLST?
z Parameterization enables you to easily move configuration files between environments. For
example, you may want to parameterize the log file locations. Does WLST support this
type of parameterization?
z How can I access custom MBeans that are registered in the WebLogic MBeanServer?
z Why am I not seeing all MBeans that are registered in the MBeanServer?
z When browsing custom MBeans, why do I get the following error message: No stub
Available?
Q. What is the relationship between WLST and the existing WebLogic Server command-line
utilities, such as wlconfig and weblogic.Deployer?
A. WLST functionality includes the capabilities of the following WebLogic Server
command-line utilities:
z weblogic.Admin utility that you use to interrogate MBeans and configure a WebLogic
Server instance (deprecated in this release of WebLogic Server)
z wlconfig Ant task tool for making WebLogic Server configuration changes (see “Using
Ant Tasks to Configure and Use a WebLogic Server Domain” in Developing Applications
with WebLogic Server)
Q. Is there a GUI that displays the MBeans in a Swing format, similar to wlshell?
A. No. This type of GUI interface in not available.
Q. If I have SSL or the administration port enabled for my server, how do I connect using WLST?
A. If you will be connecting to a WebLogic Server instance through an SSL listen port on a server
that is using the demonstration SSL keys and certificates, invoke WLST using the following
command:
java -Dweblogic.security.SSL.ignoreHostnameVerification=true
-Dweblogic.security.TrustKeyStore=DemoTrust weblogic.WLST
Otherwise, at a command prompt, enter the following command:
java weblogic.WLST
Q. In the event of an error, can you control whether WLST continues or exits?
A. Yes, using the exitonerror variable. Set this variable to true to specify that execution
should exit when WLST encounters an error, or false to continue execution. This variable
defaults to true. For more information, see “WLST Variable Reference” on page A-122.
Q. Why do I have to specify ( and ) after each command, and enclose arguments in single- or
double-quotes?
A. This is the proper Jython syntax. For more information, see http://www.jython.org.
Q. Can I start a server, deploy applications, and then shutdown the server using WLST?
A. Yes. For information about:
z Starting and shutting down servers, see “Life Cycle Commands” on page A-91.
Q. Parameterization enables you to easily move configuration files between environments. For
example, you may want to parameterize the log file locations. Does WLST support this type of
parameterization?
A. Yes. You can use the loadProperties command to load your variables and values from a
properties file. When you use the variables in your script, during execution, the variables are
replaced with the actual values from the properties file.
Q. Why am I not seeing all MBeans that are registered in the MBeanServer?
A. There are internal and undocumented MBeans that are not shown by WLST.
Also, because WLST offline enables you to access and update the configuration objects that
appear in the configuration files only, if you wish to view and/or change attribute values for a
configuration object that is not already persisted in the configuration files as an XML element,
you must first create the configuration object.
Q. When browsing custom MBeans, why do I get the following error message: No stub
Available?
A. When browsing the custom MBeans, the cmo variable is not available.
A. Yes. You can update the WLST home directory to define custom WLST commands, WLST
commands within a library, and WLST commands as a Jython module. For more information, see
“Customizing WLST” on page 2-14.