The following sections describe the WLST commands and variables in detail. Topics include:
Note: | It is recommended that you review Syntax for WLST Commands for command syntax requirements. |
WLST commands are divided into the following categories.
Use the WLST browse commands, listed in Table A-2, to navigate the hierarchy of configuration or runtime beans and control the prompt display.
Command Category: Browse Commands
Use with WLST: Online or Offline
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. |
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>
Command Category: Browse Commands
Use with WLST: Online
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
.
currentTree()
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
wls:/mydomain/serverRuntime>
ServerRuntimeMBean as the root.
For more help, use help('serverRuntime')myTree()
wls:/mydomain/edit>
Command Category: Browse Commands
Use with WLST: Online or Offline
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.
In the event of an error, the command returns a WLSTException
.
If you run |
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>
Command Category: Browse Commands
Use with WLST: Online or Offline
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.
In the event of an error, the command returns a WLSTException
.
pwd()
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'
Use the WLST control commands, listed in Table A-3, to perform the following tasks:
Table A-3 lists the control commands for WLST configuration.
Command Category: Control Commands
Use with WLST: Offline
Extends the current domain using an application or service extension template. Use the Template Builder to create an application or service extension template. See Creating Templates Using the Domain Template Builder.
In the event of an error, the command returns a WLSTException
.
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/wlserver_10.0/common/templates/
applications/DefaultWebApp.jar')wls:/offline/wlw>
Command Category: Control Commands
Use with WLST: Offline
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
.
closeDomain()
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>
Command Category: Control Commands
Use with WLST: Offline
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
.
closeTemplate()
The following example opens an existing domain template, performs some operations, and then closes the current domain template.
wls:/offline>readTemplate('c:/bea/wlserver_10.0/common/templates/domains/
...
wls.jar')
wls:/offline/wls>closeTemplate()
wls:/offline>
Command Category: Control Commands
Use with WLST: Online or Offline
Connects WLST to a WebLogic Server instance.
Requires you to provide the credentials (user name and password) of a user who has been defined in the active WebLogic security realm. Once you are connected, a collection of security policies determine which configuration attributes you are permitted to view or modify. (See Default Security Policies for MBeans in the WebLogic Server MBean Reference.)
You can supply user credentials by doing any of the following:
storeUserConfig
command to create a user configuration file that contains your credentials in an encrypted form and a key file that WebLogic Server uses to unencrypt the credentials. On subsequent WLST sessions (or in WLST scripts), supply the name of the user configuration file and key file instead of entering the credentials on the command line. This option is recommended if you use WLST in script mode because it prevents you from storing unencrypted user credentials in your scripts.boot.properties
file. By default, when you create an Administration Server, WebLogic Server encrypts the credentials used the create the server and stores them in a boot.properties
file.
If you run the connect
command without specifying the username and password or user configuration file and key file, WLST attempts to process the command using one of the methods listed below (in order of precedence):
adminServerName
argument is not specified, then look for the boot.properties
file in ./boot.properties
or ./servers/myserver/security/boot.properties
.adminServerName
argument is specified, then look for the boot.properties
file in ./servers/
adminServerName
/security/boot.properties
, where adminServerName
is the value of the adminServerName
argument.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.
java -Dweblogic.security.SSL.ignoreHostnameVerification=true
-Dweblogic.security.TrustKeyStore=DemoTrust weblogic.WLST
For more information about invoking WLST, see Main Steps for Using WLST in Interactive or Script Mode.
TunnelingEnabled
attribute is set to true
for the WebLogic Server instance. For more information, see
“TunnelingEnabled” in WebLogic Server MBean Reference.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
.
connect([
username,
password], [
url
], [
timeout
])
connect([
userConfigFile,
userKeyFile], [
url
], [
timeout
])
connect([
url
], [
adminServer], [
timeout
])
When you invoke a WLST online command, WLST connects to an MBean server, invokes an MBean server method, and returns the results of the invocation. If the MBean server method does not return within the timeout period, WLST abandons its invocation attempt. Use the following syntax for this argument:
timeout=’ milliseconds ’
|
|
Optional. Name and location of a user configuration file which contains an encrypted username and password. Use the following syntax for this argument:
userConfigFile=’ file-system-path ’
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.)
|
|
Optional. Name and location of the key file that is associated with the specified user configuration file and is used to decrypt it. Use the following syntax for this argument:
userKeyFile=’ file-system-path ’
See storeUserConfig.
|
|
Optional. Name of the domain’s Administration Server. Causes the connect command to use the credentials that are stored in the Administration Server’s
boot.properties file. Use the following syntax for this argument:adminServerName=’ server-name ’
|
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...
Successfully connected to Admin Server 'AdminServer' 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>
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...
Successfully connected to Admin Server 'AdminServer' that belongs to domain
'mydomain'.
wls:/mydomain/serverConfig>
The following example connects WLST to a WebLogic Server instance using a user configuration and key file to provide user credentials.
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 ...
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'mydomain'.
wls:/mydomain/serverConfig>
Command Category: Control Commands
Use with WLST: Offline
Creates a domain using the specified template.
Note: | If you wish to modify the domain configuration settings when creating a domain, see Option 2 in Editing a Domain (Offline). |
Note: | The createDomain command is similar in functionality to the unpack command, as described in
Creating Templates and Domains Using the pack and unpack Commands. |
In the event of an error, the command returns a WLSTException
.
createDomain(domainTemplate, domainDir, user, password)
The following example creates a new domain using the Avitek MedRec template and sets the default username and password to weblogic
. The domain is saved to the following directory: c:/bea/user_projects/domains/medrec
.
wls:/offline> createDomain('c:/bea/wlserver_10.0/common/templates/domains
/wls_medrec.jar','c:/bea/user_projects/domains/medrec', 'weblogic', 'weblogic')
Command Category: Control Commands
Use with WLST: Online
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.
The following example disconnects from a running server:
wls:/mydomain/serverConfig>disconnect()
Disconnected from weblogic server: myserver
wls:/offline>
Command Category: Control Commands
Use with WLST: Online or Offline
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
.
exit([defaultAnswer], [exitcode])
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:\>
Command Category: Control Commands
Use with WLST: Offline
Opens an existing domain for updating.
WLST offline provides read and write access to the configuration data that is persisted in the domain’s config
directory or in a domain template JAR created using Template Builder. This data is a collection of XML documents and expresses a hierarchy of management objects.
When you open a template or domain, WLST is placed at the root of the configuration hierarchy for that domain, and the prompt is updated to reflect the current location in the configuration hierarchy. For example:
For more information, see Navigating and Interrogating MBeans.
In the event of an error, the command returns a WLSTException
.
The following example opens the medrec
domain for editing.
wls:/offline> readDomain('c:/bea/user_projects/domains/medrec')
wls:/offline/medrec>
Command Category: Control Commands
Use with WLST: Offline
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:
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.
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
.
readTemplate(templateFileName)
The following example opens the medrec.jar
domain template for domain creation.
wls:/offline> readTemplate('c:/bea/wlserver_10.0/common/templates/domains
/wls_medrec.jar')
wls:/offline/wls_medrec>
Command Category: Control Commands
Use with WLST: Offline
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
.
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()
Command Category: Control Commands
Use with WLST: Offline
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')
In the event of an error, the command returns a WLSTException
.
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/wlserver_10.0/common/templates/domains
...
/wls.jar')
wls:/offline/base_domain>writeDomain('c:/bea/user_projects/domains/base_domain')
Command Category: Control Commands
Use with WLST: Offline
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 or writeTemplate, respectively.
In the event of an error, the command returns a WLSTException
.
Note: | The writeTemplate command is similar in functionality to the pack command, as described in
Creating Templates and Domains Using the pack and unpack Commands. However, writeTemplate does not support creating a Managed Server template. |
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')
Use the WLST deployment commands, listed in Table A-4, to:
For more information about deploying applications, see Deploying Applications to WebLogic Server.
Command Category: Deployment Commands
Use with WLST: Online
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. 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. |
deploy(appName, path, [targets], [stageMode], [planPath], [options])
Optional. Staging mode for the application you are deploying. Valid values are
stage , nostage , and external_stage . For information about the staging modes, see
“Controlling Deployment File Copying with Staging Modes” in Deploying Applications to WebLogic Server. This argument defaults to null.
|
|
Optional. Comma-separated list of deployment options, specified as name-value pairs. Valid options include:
|
|
|
|
|
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.
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)
The following example deploys the jmsApp
application located at c:/myapps/demos/jmsApp/demo-jms.xml
, targeting the application module to a specific target.
wls:/mydomain/serverConfig/Servers>deploy('jmsApp',path='c:/myapps/demos/jmsApps/demo-jms.xml', subModuleTargets='jmsApp@managed1')
The following example shows how to set the application version (appVersion
) to a unique identifier to support production (side-by-side) redeployment. This example deploys the demoApp
application in the archive file located at c:/myapps/demos/app/demoApp.ear
, and sets the application and archive version numbers to the specified values.
wls:/mydomain/serverConfig> deploy('demoApp', 'c:/myapps/demos/app/demoApp.ear', archiveVersion='901-101', appVersion='901-102')
For more information about production redeployment strategies, see “Updating Applications in a Production Environment” in Deploying Applications to WebLogic Server.
Command Category: Deployment Commands
Use with WLST: Online
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. In the event of an error, the command returns a WLSTException
.
distributeApplication(appPath, [planPath], [targets], [options])
Optional. Comma-separated list of deployment options, specified as name-value pairs. For a list of valid deployment options, see the
options argument description in deploy.
|
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
.
The following example distributes the c:/myapps/BigApp
application to the myserver
, oamserver1
, and oamcluster
servers, using the deployment plan defined at c:/deployment/BigApp/plan.xml
.
wls:/offline> progress=distributeApplication('c:/myapps/BigApp', 'c:/deployment/BigApp/plan.xml', 'myserver,oamserver1,oamcluster')
Distributing Application and Plan ...
Successfully distributed the application.
The previous example stores the WLSTProgress
object in a user-defined variable, in this case, progress
. You can then use the progress
variable to determine if the distributeApplication
command has completed. For example:
wls:/mydomain/serverConfig/Servers>progress.isCompleted()
1
wls:/mydomain/serverConfig/Servers>
For more information about the WLSTProgress
object, see WLSTProgress Object.
Command Category: Deployment Commands
Use with WLST: Online
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
.
getWLDM()
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>
Command Category: Deployment Commands
Use with WLST: Online
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. In the event of an error, the command returns a WLSTException
.
loadApplication(appPath, [planPath], [createPlan])
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.
Command Category: Deployment Commands
Use with WLST: Online
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.
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.
redeploy(appName, [planPath], [options])
Optional. Comma-separated list of deployment options, specified as name-value pairs. For a list of valid deployment options, see
options argument description in deploy.
|
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.
Command Category: Deployment Commands
Use with WLST: Online
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. In the event of an error, the command returns a WLSTException
.
startApplication(appName, [options])
Optional. Comma-separated list of deployment options, specified as name-value pairs. For a list of valid deployment options, see
options argument description in deploy.
|
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.
Command Category: Deployment Commands
Use with WLST: Online
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.
In the event of an error, the command returns a WLSTException
.
stopApplication(appName, [options])
Optional. Comma-separated list of deployment options, specified as name-value pairs. For a list of valid deployment options, see
options argument description in deploy.
|
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.
Command Category: Deployment Commands
Use with WLST: Online
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. In the event of an error, the command returns a WLSTException
.
For more information about deploying and undeploying applications, see “Overview of Common Deployment Scenarios” in Deploying Applications to WebLogic Server.
undeploy(appName,[targets],[options])
Optional. Comma-separated list of deployment options, specified as name-value pairs. For a list of valid deployment options, see
options argument description in deploy.
|
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 .>
Completed the undeployment of Application with status
Current Status of your Deployment:
Deployment command type: undeploy
Deployment State : completed
Deployment Message : no message
wls:/mydomain/serverConfig>
Command Category: Deployment Commands
Use with WLST: Online
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. In the event of an error, the command returns a WLSTException
.
updateApplication(appName, [planPath], [options])
Optional. Comma-separated list of deployment options, specified as name-value pairs. For a list of valid deployment options, see
options argument description in deploy.
|
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.
Use the WLST diagnostics commands, listed in Table A-5, to retrieve diagnostics data by executing queries against the WebLogic Diagnostics Framework (WLDF) data stores. For more information about WLDF, see Configuring and Using the WebLogic Diagnostics Framework.
Command Category: Diagnostics Commands
Use with WLST: Offline
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.
In the event of an error, the command returns a WLSTException
.
exportDiagnosticData([options])
Optional. Comma-separated list of export diagnostic options, specified as name-value pairs. Valid options include:
|
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')
{'elfFields': '', 'logName': 'myserver.log', 'logRotationDir': '.',
'endTimestamp': 9223372036854775807L, 'exportFileName': 'export.xml',
'storeDir': '../data/store/diagnostics', 'logicalName': 'ServerLog',
'query': '', 'beginTimestamp': 0}
Exporting diagnostic data to export.xml
<Aug 2, 2005 6:58:21 PM EDT> <Info> <Store> <BEA-280050> <Persistent store
"WLS_DIAGNOSTICS" opened: directory="c:\bea\wlserver_10.0\server\data\store\diagnostics"
writePolicy="Disabled" blockSize=512 directIO=false driver="wlfileio2">
wls:/mydomain/serverRuntime>
Command Category: Diagnostics Commands
Use with WLST: Online
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 Configuring and Using the WebLogic Diagnostic Framework.
In the event of an error, the command returns a WLSTException
.
exportDiagnosticDataFromServer([options])
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")
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 and startEdit, respectively. |
Note: | 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. |
Note: | For more information about editing configuration beans, see Using WLST Online to Update an Existing Domain. |
Command Category: Editing Commands
Use with WLST: Online
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
.
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, block is always set to true .
|
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>
Command Category: Editing Commands
Use with WLST: Offline
Assigns resources to one or more destinations.
In the event of an error, the command returns a WLSTException
.
assign(sourceType, sourceName, destinationType, destinationName)
Use the following guidelines for setting the sourceType
and destinationType
:
myServer
and myServer2
to the cluster myCluster
.wls:/offline/mydomain> assign("Server", "myServer,myServer2", "Cluster", "myCluster")
myCluster
.wls:/offline/mydomain> assign("Server", "*", "Cluster", "myCluster")
myAppDeployment
to the target server newServer
.wls:/offline/mydomain> assign("AppDeployment", "myAppDeployment", "Target", "newServer")
newUser
to the group Monitors
.wls:/offline/mydomain> assign("User", "newUser", "Group", "Monitors")
myQueueSubDeployment
, which is a child of the JMS resource myJMSResource
, to the target server newServer
.wls:/offline/mydomain> assign('JMSSystemResource.SubDeployment', 'myJMSResource.myQueueSubDeployment', 'Target', 'newServer')
MedRecAppScopedJMS.MedRecJMSServer
, which is a child of the AppDeployment AppDeployment
, to the target server AdminServer
.wls:/offline/mydomain>assign('AppDeployment.SubDeployment.SubDeployment
','MedRecEAR.MedRecAppScopedJMS.MedRecJMSServer','Target','AdminServer')
Command Category: Editing Commands
Use with WLST: Offline
Note: | This command is deprecated as of WebLogic Server 9.0. You should update your script to use the assign command as described in assign. 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. |
In the event of an error, the command returns a WLSTException
.
assignAll(sourceType, destinationType, destinationName)
The following example assigns all services to the servers adminServer
and cluster1
.
wls:/offline/mydomain> assignAll("Services", "Target", "adminServer,cluster1")
The following services, if present, are assigned to the specified targets: MigratableRMIService
, Shutdownclass
, Startupclass
, FileT3
, RMCFactory
, MailSession
, MessagingBridge
, JMSConnectionFactory
, JDBCConnectionPool
, JDBCMultipool
, JDBCTxDatasource
, JDBCDataSource
, JDBCPoolComp
, JoltConnectionPool
, WLECConnectionPool
, and WTCServer
.
Command Category: Editing Commands
Use with WLST: Online
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
.
The following example cancels the current editing session. WLST prompts for verification before canceling.
wls:/mydomain/edit !>cancelEdit()
Sure you would like to cancel the edit session? (y/n)y
Edit session is cancelled successfully
wls:/mydomain/edit>
Command Category: Editing Commands
Use with WLST: Online or Offline
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. |
Please note the following when using the create
command with WLST online:
create
command for runtime MBeans or when WLST is connected to a Managed Server instance. edit
command before issuing this command. See edit.
Please note the following when using the create
command with WLST offline:
create(name, childMBeanType, [baseProviderType])
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 MBean Reference.
|
|
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.SQLAuthenticator','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', '')
Command Category: Editing Commands
Use with WLST: Online or Offline
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. |
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 MBean Reference.
|
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 !>
Command Category: Editing Commands
Use with WLST: Online
Encrypts the specified string. You can then use the encrypted string in your configuration file or as an argument to a command.
You must invoke this command once for each domain in which you want to use the encrypted string. The string can be used only in the domain for which it was originally encrypted.
In the event of an error, the command returns a WLSTException
.
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')
Command Category: Editing Commands
Use with WLST: Online or Offline
Returns the value of the specified attribute. For more information about the MBean attributes that can be viewed, see
WebLogic Server MBean Reference. 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. |
Alternatively, you can use the cmo
variable to perform any get method on the current configuration bean. For example:
For more information about the cmo
variable, see Changing the Current Management Object.
The following example returns the value of the AdministrationPort
for the current configuration bean.
wls:/mydomain/serverConfig> get('AdministrationPort')
9002
Alternatively, you can use the cmo
variable:
cmo.getAdministrationPort()
Command Category: Editing Commands
Use with WLST: Online
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
.
getActivationTask()
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
Command Category: Editing Commands
Use with WLST: Online
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
.
invoke(methodName, parameters, signatures)
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>
Command Category: Editing Commands
Use with WLST: Online
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
.
isRestartRequired([attributeName])
The following example specifies whether a server restart is required for all changes made during the current WLST session.
wls:/mydomain/edit !> isRestartRequired()
Server re-start is REQUIRED for the set of changes in progress.
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.
wls:/mydomain/edit !>isRestartRequired("ConsoleEnabled")
Server re-start is REQUIRED if you change the attribute ConsoleEnabled wls:/mydomain/edit !>
Command Category: Editing Commands
Use with WLST: Offline
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 (see readDomain and readTemplate).
Before executing this command, ensure that the following conditions are true:
To verify that the appropriate SQL files exist, open the domain template and locate the relevant SQL file list, jdbc.index
, in the _jdbc_
directory. For example, for PointBase version 4.4, the SQL file list is located at _jdbc_\Pointbase\44\jdbc.index
.
The command fails if the above conditions are not met.
In the event of an error, the command returns a WLSTException
.
loadDB(dbVersion, datasourceName, dbCategory)
For more information about the
jdbc.index file and database categories, see “Files Typically Included in a Template” in Domain Template Reference, which is available at
http://edocs.bea.com/common/docs100/tempref/tempref.html
|
The following example loads SQL files related to Drop/Create P13N Database Objects
intended for version 5.1
of the database, using the p13nDataSource
JDBC data source.
wls:/offline/mydomain> loadDB('5.1', 'p13nDataSource', 'Drop/Create P13N Database Objects')
Command Category: Editing Commands
Use with WLST: Online and Offline
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.
In the event of an error, the command returns a WLSTException
.
This example gets and sets the properties file values.
wls:/mydomain/serverConfig> loadProperties('c:/temp/myLoad.properties')
Command Category: Editing Commands
Use with WLST: Online
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.
In the event of an error, the command returns a WLSTException
.
save()
The following example saves the edits that have not yet been saved to disk.
wls:/mydomain/edit !>save()
Saving all your changes ...
Saved all your changes successfully.
wls:/mydomain/edit !>
Command Category: Editing Commands
Use with WLST: Online or Offline
Sets the value of a specified attribute in the current management object. When using WLST offline, this command writes the attribute value to the domain’s configuration files. When using WLST online, this command sets the value of an MBean attribute. Online changes are written to the domain’s configuration file when you activate your edits.
In the event of an error, the command returns a WLSTException
.
For information about setting encrypted attributes (all encrypted attributes have names that end with Encrypted
), see Writing and Reading Encrypted Configuration Values.
Note the following when using WLST online:
cmo
variable with the following syntax:cmo.set
attrName
(
value
)
For example, instead of using set(‘ListenPort’, 7011)
, you can use: cmo.setListenPort(7011)
For more information about the cmo
variable, see Changing the Current Management Object.
|
The following example sets the ArchiveConfigurationCount
attribute of DomainMBean
to 10
:
wls:/mydomain/serverConfig> set('ArchiveConfigurationCount',10)
The following example sets the long value of the T1TimerInterval
attribute of a custom Mbean to 123
:
wls:/mydomain/serverConfig> set(‘T1TimerInterval’, Long(123))
The following example sets the boolean value of the MyBooleanAttribute
attribute of a custom Mbean t
o true
:
wls:/mydomain/serverConfig> set(‘MyBooleanAttribute’, Boolean(true))
Command Category: Editing Commands
Use with WLST: Offline
Sets options related to a domain creation or update. In the event of an error, the command returns a WLSTException
.
setOption(optionName, optionValue)
The following example sets the CreateStartMenu
option to false
:
wls:/offline> setOption('CreateStartMenu', 'false')
Command Category: Editing Commands
Use with WLST: Online
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
.
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:
MBean Changed : com.bea:Name=basicWLSDomain,Type=Domain
Operation Invoked : add
Attribute Modified : Machines
Attributes Old Value : null
Attributes New Value : Mach1
Server Restart Required : false
MBean Changed : com.bea:Name=basicWLSDomain,Type=Domain
Operation Invoked : add
Attribute Modified : Servers
Attributes Old Value : null
Attributes New Value : myserver
Server Restart Required : false
Command Category: Editing Commands
Use with WLST: Online
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.
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. |
startEdit([waitTimeInMillis], [timeoutInMillis], [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 .
|
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 !>
Command Category: Editing Commands
Use with WLST: Online
Stops the current edit session, releases the edit lock, and discards unsaved changes.
In the event of an error, the command returns a WLSTException
.
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>
Command Category: Editing Commands
Use with WLST: Offline
Unassign applications or resources from one or more destinations.
In the event of an error, the command returns a WLSTException
.
unassign(sourceType, sourceName, destinationType, destinationName)
|
|
Name of the application or resource to be unassigned. Multiple names can be specified, separated by commas, or you can use the wildcard (*) character to specify all resources of the specified type.
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.
|
|
Use the following guidelines for setting the sourceType
and destinationType
:
myServer
and myServer2
from the cluster myCluster
.wls:/offline/medrec> unassign("Server", "myServer,myServer2", "Cluster", "myCluster")
myCluster
.wls:/offline/mydomain> unassign("Server", "*", "Cluster", "myCluster")
newUser
from the group Monitors
.wls:/offline/medrec> unassign("User", "newUser", "Group", "Monitors")
myAppDeployment
from the target server newServer
.wls:/offline/mydomain> unassign("AppDeployment", "myAppDeployment", "Target", "newServer")
MedRecAppScopedJMS.MedRecJMSServer
, which is a child of the AppDeployment AppDeployment
, from the target server AdminServer
.wls:/offline/mydomain> assign('AppDeployment.SubDeployment.SubDeployment',
'MedRecEAR.MedRecAppScopedJMS.MedRecJMSServer', 'Target','AdminServer')
Command Category: Editing Commands
Use with WLST: Offline
Note: | This command is deprecated as of WebLogic Server 9.0. You should update your script to use the unassign command as described in unassign. 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
.
unassignAll(sourceType, destinationType, destinationName)
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
.
Command Category: Editing Commands
Use with WLST: Online
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
.
undo([unactivateChanges], [defaultAnswer])
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>
Command Category: Editing Commands
Use with WLST: Online
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
.
validate()
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
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.
Command Category: Information Commands
Use with WLST: Online
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
.
addListener(mbean, [attributeNames], [logFile], [listenerName])
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-listener")
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.
The configToScript command creates the following files:
When you run the generated script:
In the event of an error, the command returns a WLSTException
.
configToScript([configPath], [pyPath], [overwrite], [propertiesFile], [createDeploymentScript])
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',
configToScript is loading configuration from c:\bea\user_projects\domains\mydomain\config\config.xml ...
'c:/bea/myscripts')
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>
Command Category: Information Commands
Use with WLST: Online or Offline
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
.
This example displays the stack trace.
wls:/myserver/serverConfig>dumpStack()
com.bea.plateng.domain.script.jython.WLSTException: java.lang.reflect.Invocation TargetException
...
Command Category: Information Commands
Use with WLST: Online or Offline
Displays all the variables used by WLST, including their name and value. In the event of an error, the command returns a WLSTException
.
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:AdminServer', oid: '259', channel: 'null'
cmgr [MBeanServerInvocationHandler]com.bea:Name=ConfigurationManager,
Type=weblogic.management.mbeanservers.edit.ConfigurationManagerMBean
cmo [MBeanServerInvocationHandler]com.bea:Name=mydomain,Type=Domain
connected true
domainName mydomain
...
wls:/mydomain/serverConfig>
Command Category: Information Commands
Use with WLST: Online
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
.
find([name], [type], [searchInstancesOnly])
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>
Command Category: Editing Commands
Use with WLST: Online
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
.
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'
Command Category: Information Commands
Use with WLST: Online
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. |
The following example returns the MBean specified by the path.
wls:/mydomain/edit !>com=getMBean('Servers/myserver/COM/myserver')
wls:/mydomain/edit !>com.getType()
‘Server’
Command Category: Information Commands
Use with WLST: Online
Returns the MBeanInfo
for the specified MBeanType
or the cmo
variable. In the event of an error, the command returns a WLSTException
.
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')
Command Category: Information Commands
Use with WLST: Online
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
.
The following example returns the MBean specified by the path.
wls:/mydomain/edit !>path=getPath('com.bea:Name=myserver,Type=Server')
wls:/mydomain/edit !>print path
'Servers/myserver'
Command Category: Information Commands
Use with WLST: Online
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.
In the event of an error, the command returns a WLSTException
.
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>
Command Category: Information Commands
Use with WLST: Online
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
.
lookup(name, [childMBeanType])
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>
Command Category: Information Commands
Use with WLST: Online or Offline
Lists the attributes, operations, and child management objects of the specified management object.
In the event of an error, the command returns a WLSTException
.
By default, the output is returned as a string and is arranged in three columns:
:
parameterType(
parameterName)
Indicates that the item is a child management object or an attribute that is readable, assuming that current user has been given read permission by the security realm’s policies. (See
Default Security Policies for MBeans in the WebLogic Server MBean Reference.)
|
|
Indicates that the item is an attribute that is writable, assuming that current user has been given write permission by the security realm’s policies. (See
Default Security Policies for MBeans in the WebLogic Server MBean Reference.)
|
|
Indicates that the item is an operation that can be executed, assuming that current user has been given execute permission by the security realm’s policies. (See
Default Security Policies for MBeans in the WebLogic Server MBean Reference.)
|
By default, the output lists all attributes, operations, and child management objects of the current management object. To filter the output or to see a list for a different management object, you can specify a command argument.
Note the following when using WLST offline:
Log
management object.
If you want to change the default value of attributes whose management object is not displayed by WLST offline, you must first use the create
command to create the management object. Then you can cd
to the management object and change the attribute value. See create.
ls( [
moPath ]
returnMap
[
returnType
]
)
Optional. Path name to the management object for which you want to list attributes, operations, and child management objects.
You can specify a pathname that is relative to your current location in the hierarchy or an absolute pathname.
With WLST offline, use the forward-slash character (
/ ) to specify the root of the configuration document.
With WLST online, you can list the contents of MBeans in any management hierarchy (see Tree Commands). Use the following syntax to specify the root of a hierarchy:
root-name :/
|
|
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-- CustomResources
dr-- DeploymentConfiguration
dr-- Deployments
dr-- EmbeddedLDAP
dr-- ErrorHandlings
dr-- FileStores
dr-- InternalAppDeployments
dr-- InternalLibraries
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-- ConsoleContextPath console
-r-- ConsoleEnabled true
-r-- ConsoleExtensionDirectory console-ext
-r-- DomainVersion 9.0.0.0
-r-- LastModificationTime 0
-r-- Name basicWLSDomain
-r-- Notes null
-r-- Parent null
-r-- ProductionModeEnabled false
-r-- RootDirectory .
-r-- Type Domain
wls:/mydomain/serverConfig>
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', 'true', 'a')
-rw- AcceptBacklog 50
-rw- AdminReconnectIntervalSeconds 10
-rw- AdministrationPort 9002
-rw- AdministrationProtocol t3s
-rw- AutoKillIfFailed false
-rw- AutoMigrationEnabled false
-rw- AutoRestart true
-rw- COMEnabled false
-rw- ClasspathServletDisabled false
-rw- ClientCertProxyEnabled false
-rw- Cluster null
-rw- ClusterRuntime null
-rw- ClusterWeight 100
wls:/mydomain/serverConfig>
Command Category: Information Commands
Use with WLST: Online
Displays help from MBeanInfo
for the current MBean or its specified attribute. In the event of an error, the command returns a WLSTException
.
The following example displays help from MBeanInfo
for the ServerMBean
bean.
wls:/mydomain/serverConfig>man('Servers')
dynamic : true
creator : createServer
destroyer : destroyServer
description : <p>Returns the ServerMBeans representing the servers that have been configured to be part of this domain.</p>
descriptorType : Attribute
Name : Servers
interfaceClassName : [Lweblogic.management.configuration.ServerMBean;
displayName : Servers
relationship : containment
Command Category: Information Commands
Use with WLST: Online or Offline
Redirects WLST information, error, and debug messages to the specified filename. Also redirects the output of the dumpStack()
and dumpVariables()
commands to the specified filename.
In the event of an error, the command returns a WLSTException
.
redirect(outputFile, [toStdOut])
The following example begins redirecting WLST output to the logs/wlst.log
file:
wls:/mydomain/serverConfig> redirect('./logs/wlst.log')
Command Category: Information Commands
Use with WLST: Online
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.
In the event of an error, the command returns a WLSTException
.
removeListener([mbean], [listenerName])
The following example removes the listener named mylistener
.
wls:/mydomain/serverConfig> removeListener(listenerName="mylistener")
Command Category: Information Commands
Use with WLST: Online
Shows all listeners that are currently defined. For information about setting a listener, see addListener.
In the event of an error, the command returns a WLSTException
.
showListeners()
The following example shows all listeners that are currently defined.
wls:/mydomain/serverConfig> showListeners()
Command Category: Information Commands
Use with WLST: Online or Offline
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.
startRecording(recordFile, [recordAll])
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>
Command Category: Information Commands
Use with WLST: Online
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.
In the event of an error, the command returns a WLSTException
.
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>
The following example returns the state of the cluster, mycluster
.
wls:/mydomain/serverConfig>state('mycluster','Cluster')
There are 3 server(s) in cluster: mycluster
States of the servers are
MServer1---SHUTDOWN
MServer2---SHUTDOWN
MServer3---SHUTDOWN
wls:/mydomain/serverConfig>
Command Category: Information Commands
Use with WLST: Online or Offline
Stops recording WLST commands. For information about starting a recording, see startRecording.
In the event of an error, the command returns a WLSTException
.
The following example stops recording WLST commands.
wls:/mydomain/serverConfig>stopRecording()
Stopping recording to c:\myScripts\record.py
wls:/mydomain/serverConfig>
Command Category: Information Commands
Use with WLST: Online or Offline
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
.
stopRedirect()
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
Command Category: Information Commands
Use with WLST: Online
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
.
storeUserConfig([
userConfigFile
], [
userKeyFile
], [
nm
])
Optional. Name of the file to store the user configuration. The pathname can be absolute or relative to the file-system directory from which you started WLST.
If you do not specify this argument, the command stores the file in your home directory as determined by your JVM. The location of the home directory depends on the SDK and type of operating system on which WLST is running.The default filename is based on the following pattern:
username -WebLogicConfig.properties where username is the user name that you used to log in to the operating system. |
|
Optional. 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 file-system directory from which you started WLST.
If you do not specify this argument, the command stores the file in your home directory as determined by your JVM. The location of the home directory depends on the SDK and type of operating system on which WLST is running. The default filename is based on the following pattern:
username -WebLogicKey.properties where username is the user name that you used to log in to the operating system. |
|
The following example creates and stores a user configuration file and key file in the default location.
wls:/mydomain/serverConfig>storeUserConfig()
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 ny
The username and password that were used for this current WLS connection are stored in stored in C:\Documents and Settings\pat\pat-WebLogicConfig.properties and
C:\Documents and Settings\pat\pat-WebLogicKey.properties.
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 ny
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>
Command Category: Information Commands
Use with WLST: Online or Offline
Displays a thread dump for the specified server. In the event of an error, the command returns a WLSTException
.
threadDump([writeToFile], [fileName], [serverName])
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 .
|
|
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')
Command Category: Information Commands
Use with WLST: Online
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
.
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>
Command Category: Editing Commands
Use with WLST: Online
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.
In the event of an error, the command returns a WLSTException
.
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>
Use the WLST life cycle commands, listed in Table A-9, to manage the life cycle of a server instance.
For more information about the life cycle of a server instance, see “Understanding Server Life Cycle” in Managing Server Startup and Shutdown.
Command Category: Life Cycle Commands
Use with WLST: Online
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
.
For information about migrating services, see Service-Level Migration in Using WebLogic Server Clusters.
migrate(sname
,destinationName
, [sourceDown
], [destinationDown
], [migrationType
])
Optional. Boolean value specifying whether the destination server is down. This argument defaults tofalse
, indicating that the destination server is running.If the destination is not running, and you do not set this argument totrue
, WLST returns aMigrationException
.When migrating JMS-related services to a non-running server instance, the server instance will activate the JMS services 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.
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 !>
Command Category: Life Cycle Commands
Use with WLST: Online
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.
In the event of an error, the command returns a WLSTException
.
Optional. Boolean value specifying whether WLST should block user interaction until the server is resumed. 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, block is always set to true .
|
The following example resumes a Managed Server instance.
wls:/mydomain/serverConfig>resume('managed1', block='true')
Server 'managed1' resumed successfully.
wls:/mydomain/serverConfig>
Command Category: Life Cycle Commands
Use with WLST: Online
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
.
shutdown([name], [entityType], [ignoreSessions], [timeOut], [force], [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, block is always set to true .
|
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 seconds) 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
The following example instructs WLST to shutdown the cluster mycluster
:
wls:/mydomain/serverConfig>shutdown('mycluster','Cluster')
Shutting down the cluster with name mycluster
Shutdown of cluster mycluster has been issued, please
refer to the logs to check if the cluster shutdown is successful.
Use the state(<server-name>) or state(<cluster-name>,"Cluster")
to check the status of the server or cluster
wls:/mydomain/serverConfig>state('mycluster','Cluster')
There are 3 server(s) in cluster: mycluster
States of the servers are
MServer1---SHUTDOWN
MServer2---SHUTDOWN
MServer3---SHUTDOWN
wls:/mydomain/serverConfig>
Command Category: Life Cycle Commands
Use with WLST: Online
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.
In the event of an error, the command returns a WLSTException
.
start(name, [type], [url], [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, block is always set to true .
|
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>
Command Category: Life Cycle Commands
Use with WLST: Online or Offline
Starts the Administration Server. In the event of an error, the command returns a WLSTException
.
startServer([adminServerName], [domainName], [url], [username], [password],
[domainDir], [block], [timeout], [serverLog], [systemProperties], [jvmArgs])
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, block is always set to true .
|
|
The following example starts the Administration Server named demoServer
in the demoDomain
.
wls:/offline> startServer('demoServer','demoDomain','t3://localhost:8001',
'myweblogic','wlstdomain','c:/mydomains/wlst','false', 60000, jvmArgs='-XX:MaxPermSize=75m, -Xmx512m, -XX:+UseParallelGC')
wls:/offline>
Command Category: Life Cycle Commands
Use with WLST: Online
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.
In the event of an error, the command returns a WLSTException
.
suspend([sname], [ignoreSessions], [timeOut], [force], [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, block is always set to true .
|
The following example suspends a Managed Server instance:
wls:/mydomain/serverConfig> suspend('managed1')
Server 'managed1' suspended successfully.
wls:/mydomain/serverConfig>
Use the WLST Node Managers commands, listed in Table A-10, to start, shut down, restart, and monitor WebLogic Server instances.
Node Manager must be running before you can execute the commands within this category.
For more information about Node Manager, see “Using Node Manager to Control Servers” in Managing Server Startup and Shutdown.
Command Category: Node Manager Commands
Use with WLST: Online or Offline
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
.
nm()
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>
Command Category: Node Manager Commands
Use with WLST: Online or Offline
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.
In the event of an error, the command returns a WLSTException
.
nmConnect([username, password], [host], [port], [domainName], [domainDir] [nmType], [verbose])
nmConnect([userConfigFile, userKeyFile], [host], [port], [domainName], [domainDir] [nmType], [verbose])
|
|||
|
|||
|
|||
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.)
|
|||
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.)
|
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>
The following example connects WLST to a Node Manager Server instance using a user configuration and key file to provide user credentials.
wls:/myserver/serverConfig>nmConnect(userConfigFile='c:/myfiles/myuserconfigfile.secure', userKeyFile='c:/myfiles/myuserkeyfile.secure',
host='172.18.137.82', port=26106, domainName='mydomain',
domainDir='c:/myfiles/mydomain', mType='plain')
Connecting to Node Manager Server ...
Successfully connected to Node Manager.
wls:/nm/mydomain>
Command Category: Node Manager Commands
Use with WLST: Online or Offline
WLST must be connected to Node Manager to run this command.
Disconnects WLST from a Node Manager session.
In the event of an error, the command returns a WLSTException
.
nmDisconnect()
The following example disconnects WLST from a Node Manager session.
wls:/nm/oamdomain>nmDisconnect()
Successfully disconnected from Node Manager
wls:/myserver/serverConfig>
Command Category: Node Manager Commands
Use with WLST: Online
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:
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
.
nmEnroll([domainDir], [nmHome])
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 atc:\bea\mydomain\common\nodemanager
....
Successfully enrolled this machine with the domain directory at C:\bea\mydomain\common\nodemanager
wls:/mydomain/serverConfig>
Command Category: Node Manager Commands
Use with WLST: Online
Generates the Node Manager property files, boot.properties
and startup.properties
, for the specified server. The Node Manager property files are stored relative to the root directory of the specified server. The target root directory must be on the same machine on which you are running the command.
You must specify the name of a server; otherwise, the command will fail.
In the event of an error, the command returns a WLSTException
.
nmGenBootStartupProps(serverName)
The following example generates boot.properties
and startup.properties
in the root directory of the specified server, ms1
.
wls:/mydomain/serverConfig>nmGenBootStartupProps('ms1')
Successfully generated boot.properties at c:\bea\mydomain\servers\ms1\data\nodemanager\boot.properties
Successfully generated startup.properties at c:\bea\mydomain\servers\ms1\data\nodemanager\startup.properties
wls:/mydomain/serverConfig>
Command Category: Node Manager Commands
Use with WLST: Online or Offline
WLST must be connected to Node Manager to run this command.
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.
In the event of an error, the command returns a WLSTException
.
The following example kills the server named oamserver
.
wls:/nm/oamdomain>nmKill('oamserver')
Killing server ‘oamserver’ ...
Server oamServer killed successfully.
wls:/nm/oamdomain>
Command Category: Node Manager Commands
Use with WLST: Online or Offline
WLST must be connected to Node Manager to run this command.
In the event of an error, the command returns a WLSTException
.
The following example displays the Node Manager log.
wls:/nm/oamdomain>nmLog()
Successfully retrieved the Node Manager log and written.
wls:/nm/oamdomain>
Command Category: Node Manager Commands
Use with WLST: Online or Offline
WLST must be connected to Node Manager to run this command.
Returns the server output log of the server that was started with Node Manager.
In the event of an error, the command returns a WLSTException
.
nmServerLog([serverName], [writer])
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>
Command Category: Node Manager Commands
Use with WLST: Online or Offline
WLST must be connected to Node Manager to run this command.
Returns the status of the server that was started with Node Manager.
In the event of an error, the command returns a WLSTException
.
The following example displays the status of the server named oamserver
, which was started with Node Manager.
wls:/nm/oamdomain>nmServerStatus('oamserver')
RUNNING
wls:/nm/oamdomain>
Command Category: Node Manager Commands
Use with WLST: Online or Offline
WLST must be connected to Node Manager to run this command.
Starts a server in the current domain using Node Manager.
In the event of an error, the command returns a WLSTException
.
Note: | boot.properties must exist in order to start a server with nmStart .If this is the first time you are starting a server, you must manually create it in order to use nmStart. |
nmStart([serverName], [domainDir], [props], [writer])
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>
Command Category: Node Manager Commands
Use with WLST: Online or Offline
WLST must be connected to Node Manager to run this command.
Returns the Node Manager version.
In the event of an error, the command returns a WLSTException
.
nmVersion()
The following example displays the Node Manager version.
wls:/nm/oamdomain>nmVersion()
The Node Manager version that you are currently connected to is 9.0.0.0
wls:/nm/oamdomain>
Command Category: Node Manager Commands
Use with WLST: Online or Offline
Starts Node Manager on the same computer that is running WLST.
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 Installing Node Manager as a Windows Service” in BEA Products Installation Guide. 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
In the event of an error, the command returns a WLSTException
.
startNodeManager([verbose], [nmProperties])
The following example displays the Node Manager server version.
wls:/mydomain/serverConfig> startNodeManager(verbose='true', NodeManagerHome='c:/bea/wlserver_10.0/common/nodemanager', ListenPort='6666', ListenAddress='myhost'))
Launching Node Manager ...
Successfully launched the Node Manager.
The Node Manager process is running independent of the WLST process
Exiting WLST will not stop the Node Manager process. Please refer
to the Node Manager logs for more information.
The Node Manager logs will be under c:\bea\wlserver_10.0\common\nodemanager.
wls:/mydomain/serverConfig>
Use the WLST tree commands, listed in Table A-11, to navigate among MBean hierarchies.
Navigate to the last MBean to which you navigated in the configuration MBean hierarchy or to the root of the hierarchy,
DomainMBean .
|
||||
Navigate to the last MBean to which you navigated in the runtime hierarchy or the root of all runtime objects,
DomainRuntimeMBean .
|
||||
Command Category: Tree Commands
Use with WLST: Online
Note: | This command is deprecated as of WebLogic Server 9.0. You should update your scripts to use the serverConfig command, as described in serverConfig. |
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.
In the event of an error, the command returns a WLSTException
.
config()
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>
Command Category: Tree Commands
Use with WLST: Online
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 Developing Custom Management Utilities with JMX.
In the event of an error, the command returns a WLSTException
.
custom()
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>
Command Category: Tree Commands
Use with WLST: Online
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
.
domainConfig()
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-- CustomResources
dr-- DeploymentConfiguration
dr-- Deployments
dr-- EmbeddedLDAP
dr-- ErrorHandlings
dr-- FileStores
dr-- InternalAppDeployments
dr-- InternalLibraries
dr-- JDBCDataSourceFactories
dr-- JDBCStores
dr-- JDBCSystemResources
dr-- JMSBridgeDestinations
dr-- JMSInteropModules
dr-- JMSServers
dr-- JMSSystemResources
...
wls:/mydomain/domainConfig>
Command Category: Tree Commands
Use with WLST: Online
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
.
domainRuntime()
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-- MigrationDataRuntimes
dr-- SNMPAgentRuntime
dr-- ServerLifeCycleRuntimes
dr-- ServerRuntimes
dr-- ServerServices
-r-- ActivationTime Mon Aug 01 11:41:25 EDT 2005
-r-- Clusters null
-r-- MigrationDataRuntimes null
-r-- Name sampleMedRecDomain
-rw- Parent null
-r-- SNMPAgentRuntime null
-r-- Type DomainRuntime
-r-x restartSystemResource Void : WebLogicMBean(weblogic.management.configuration.SystemResourceMBean)
wls:/mydomain/domainRuntime>
Command Category: Tree Commands
Use with WLST: Online
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. |
Note: | For more information about editing configuration beans, see Using WLST Online to Update an Existing Domain. |
In the event of an error, the command returns a WLSTException
.
edit()
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 !>
Command Category: Tree Commands
Use with WLST: Online
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.
jndi()
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
...
Command Category: Tree Commands
Use with WLST: Online
Note: | This command is deprecated as of WebLogic Server 9.0. You should update your scripts to use the serverRuntime command, as described in serverRuntime. |
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.
runtime()
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 DomainRuntimeMBean as the root.
For more help, use help('runtime')
wls:/mydomain/runtime>
Command Category: Tree Commands
Use with WLST: Online
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.
serverConfig()
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>
Command Category: Tree Commands
Use with WLST: Online
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.
In the event of an error, the command returns a WLSTException
.
serverRuntime()
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>
Table A-12 describes WLST variables and their common usage. All variables are initialized to default values at the start of a user session and are changed according to the user interaction with WLST.
Administration MBean. This variable is available only when WLST is connected to the Administration Server.
|
||||
Current Management Object. The
cmo variable is set to the bean instance to which you navigate using WLST. You can use this variable to perform any get , set , or invoke method on the current bean instance.
|
||||
|
||||