Using the WebLogic Server Scripting Tool for Offline Configuration

     Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Using the WebLogic Server Scripting Tool for Offline Configuration

This document describes how to use the BEA Products™ Scripting Tool (WLST) for offline configuration. Topics include:

 


Introducing WLST

WLST is a command-line scripting interface that you use to configure WebLogic Server and WebLogic domains. Using WLST, WebLogic Server administrators and operators can perform administrative tasks and initiate WebLogic Server configuration changes interactively or by using an executable script.

Note: The WLST scripting environment is based on the Java scripting interpreter, Jython. For more information about the Jython language syntax, see http://www.jython.org.

WLST supports both online and offline configuration:

Refer to the following resources for additional information:

 


Getting Started Using WLST Offline Configuration

The following sections describe how to get started using WLST offline configuration. The following topics are described:

Note: For information about getting started using WLST online configuration, see "Basic Steps for Using WLST" in WebLogic Server Scripting Language, delivered with the WLST online configuration kit, WebLogic Scripting Tool (WLST) for 7.0 & 8.1 (Artifact ID S13), in the dev2dev code samples project at:
Note: https://codesamples.projects.dev2dev.bea.com/servlets/Scarab?id=13

Setting up Your Environment—WebLogic Platform 8.1 SP5 and Later

For WebLogic Platform 8.1 SP5 (or a later release of 8.1), to set up your environment for WLST offline configuration, perform the following steps:

  1. Install the WebLogic Platform 8.1 SP5 (or later release of 8.1) software, as described in the WebLogic Platform Installation Guide at:
  2. http://e-docs.bea.com/platform/docs81/install/index.html

    Note: To take full advantage of the domain and extension templates available, a full WebLogic Platform installation is recommended. At a minimum, you need to install the WebLogic Server 8.1 SP5 software, as described in the WebLogic Server and WebLogic Express Installation Guide at:
    Note: http://e-docs.bea.com/wls/docs81/install/index.html
  3. Download the WLST offline configuration kit (if you have not done so already), Configuring WebLogic Server with WLST Offline (Artifact ID S97), in the dev2dev code samples project at:
  4. https://codesamples.projects.dev2dev.bea.com/servlets/Scarab?id=97

    The WLST offline configuration kit contains the following files:

    • JAR files (config.jar, comdev.jar, and 3rdparty.jar) required to execute the WLST offline configuration tool.
    • Note: These files are included as part of the WebLogic Platform 8.1 SP5 (or later 8.1 release) software installation. They are not required to be extracted from the ZIP file.
    • Script files for invoking WLST offline configuration (runWLSToffline.cmd and runWLSToffline.sh).
    • Sample script files which are summarized in Summary of Sample Scripts.
    • README.txt file summarizing the steps required to get started using the tool.
    • This document in PDF format (wlst_offline.pdf).
  5. Extract the following files from the WLST offline configuration kit:
    • runWLSTOffline.cmd and runWLSTOffline.sh script files to WL_HOME\common\bin.
    • (Optional) Sample script files to the desired location.
  6. Update the CLASSPATH environment variable to include the following WebLogic Server, Jython, and WLST files and directories:
  7. WL_HOME\server\lib
    WL_HOME\server\lib\weblogic.jar
    WL_HOME\common\lib\jython.jar
    WL_HOME\common\lib\config.jar
    WL_HOME\common\lib\comdev.jar
    WL_HOME\common\lib\3rdparty.jar

Setting up Your Environment—WebLogic Platform 8.1 SP4, SP3, or SP2

For WebLogic Platform 8.1 SP4, SP3, or SP2, to set up your environment for WLST offline configuration, perform the following steps:

  1. Install the WebLogic Platform 8.1 SP4, SP3, or SP2 software, as described in the WebLogic Platform Installation Guide at:
  2. http://e-docs.bea.com/platform/docs81/install/index.html

    Note: To take full advantage of the domain and extension templates available, a full WebLogic Platform installation is recommended. At a minimum, you need to install the WebLogic Server 8.1 SPx software, as described in the WebLogic Server and WebLogic Express Installation Guide at:
    Note: http://e-docs.bea.com/wls/docs81/install/index.html
  3. Donwload and install Jython. For more information, see http://www.jython.org/download.html.
  4. Note: Download the WLST offline configuration kit (if you have not done so already), Configuring WebLogic Server with WLST Offline (Artifact ID S97), in the dev2dev code samples project at:
    Note: https://codesamples.projects.dev2dev.bea.com/servlets/Scarab?id=97

    The WLST offline configuration kit contains the following files:

    • JAR files (config.jar, comdev.jar, and 3rdparty.jar) required to execute the WLST offline configuration tool.
    • Script files for invoking WLST offline configuration (runWLSToffline.cmd and runWLSToffline.sh).
    • Sample script files which are summarized in Summary of Sample Scripts.
    • README.txt file summarizing the steps required to get started using the tool.
    • This document in PDF format (wlst_offline.pdf).
  5. Extract the following files from the WLST offline configuration kit:
    • WLST JAR files, including config.jar, comdev.jar, and 3rdparty.jar, to WL_HOME\common\lib
    • Note: It is recommended that you back up the existing JAR files.
    • runWLSTOffline.cmd and runWLSTOffline.sh script files to WL_HOME\common\bin.
    • (Optional) Sample script files to the desired location.
  6. Update the CLASSPATH environment variable to include the following WebLogic Server, Jython, and WLST files and directories:
  7. Note: JYTHON_HOME refers to the root directory of your Jython installation.

    WL_HOME\server\lib
    WL_HOME\server\lib\weblogic.jar

    JYTHON_HOME\jython.jar

    WL_HOME\common\lib\config.jar
    WL_HOME\common\lib\comdev.jar
    WL_HOME\common\lib\3rdparty.jar

Invoking WLST

You can invoke WLST in interactive or script mode:

The methods for invoking WLST in each mode are described in the following sections. A summary of the sample scripts available is also provided in Summary of Sample Scripts.

Invoking WLST in Interactive Mode

To invoke WLST offline configuration in interactive mode, at a command prompt enter one of the following commands:

Windows: WL_HOME\common\bin\runWLSToffline.cmd
Unix: WL_HOME/common/bin/runWLSToffline.sh

WLST starts in interactive mode, and a welcome message and the WLST offline configuration prompt appears:

Welcome to Weblogic Scripting Shell
wls_offline:/>

Note: The first time the command is run, the Jython package manager processes the JAR files in your CLASSPATH.

You can begin entering commands, setting variables, or running a script to create a new or update an existing domain.

To run a WLST script in interactive mode, enter the execfile command, as follows:

execfile(WLST_script)

WLST_script specifies the full pathname to the WLST script file. For a summary of the sample script files available, see Summary of Sample Scripts.

For more information about the WLST commands and variables, see WLST Offline Configuration Commands and WLST Offline Configuration Variables, respectively.

Invoking WLST in Script Mode

To invoke WLST offline configuration in script mode, at a command prompt enter one of the following commands:

Windows: WL_HOME\common\bin\runWLSToffline.cmd WLST_script
Unix: WL_HOME/common/bin/runWLSToffline.sh WLST_script

The WLST_script argument specifies the full pathname to a WLST script file. For a summary of the sample script files available, see Summary of Sample Scripts.

WLST starts in script mode, executing the specified script without requiring your input.

Summary of Sample Scripts

Table 1 summarizes the WLST offline configuration sample scripts that you can run or use as templates for creating additional scripts.

Table 1 WLST Offline Configuration Example Scripts 
Script
Description
domain_platform.py
Creates a WebLogic domain using the Basic WebLogic Platform Domain template. The script demonstrates the basic steps required to create a domain from a domain template.
domain_WLS.py
Creates a WebLogic domain using the Basic WebLogic Server Domain template. The script demonstrates how to open a domain template, create and edit configuration objects, and write the domain configuration information to the specified directory.
domain_extension.py
Creates a WebLogic domain using the Basic WebLogic Server Domain template and extends it to support WebLogic Workshop. The script demonstrates how to extend a domain using an extension template.
wliClusterDomain.py
Creates a WebLogic domain using the Basic WebLogic Integration Domain template. The script demonstrates how to create, configure, and assign servers to a cluster.

 


WLST Offline Configuration Variables

Table 2 describes WLST offline configuration 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.

Note: While in interactive mode, you can display help information for the WLST offline configuration variables using the help(`variables') command. For more information, see help.

Table 2 WLST Offline Configuration Variables 
Variable
Description
Default
cmo
Specifies the Current Management Object. This variable is set to the configuration object to which you have navigated.
You use this variable to perform any get or set method on the current configuration object. For example:
cmo.setPassword(`weblogic')
Alternatively, you can use the WLST get and set commands, as described in Edit Commands.
Initialized to the root of all domain configuration objects.
exitonerror
Specifies whether to terminate script execution when WLST encounters an exception.This variable is not applicable when running WLST in interactive mode.
True
isrecording
Specifies whether user interactions are being saved in a file. This variable should not be set explicitly; it is set to True and False by the startRecording() and stopRecording() commands, respectively.
False

 


WLST Offline Configuration Commands

WLST offline configuration commands (primitives) are executable functions that are extensions to the Jython language and that follow the Jython syntax.

The following sections describe WLST offline configuration commands and how to use them. These commands are available when using WLST for offline configuration in interactive and script mode.

WLST offline configuration commands are divided into the following four categories:

The commands in each category are described in the following sections. Befor proceeding, it is recommended that you review Guidelines for Entering WLST Commands.

Guidelines for Entering WLST Commands

Please review the following guidelines for entering WLST commands:

Control Commands

Similar to the Configuration Wizard, the control commands for WLST offline configuration enable you to perform the following tasks:

Table 3 lists the control commands for WLST offline configuration used to create a new or update an existing domain, or to exit WLST.

Table 3 Control Commands for WLST Offline Configuration 
In order to...
Use this command...
To...
For more information, see...
Create a new domain from a domain template
Open an existing domain template for domain creation.
Write the domain configuration information to the specified directory.
Close the current domain template.
Update an existing domain
Open an existing domain for updating.
Extend the current domain using the specified application or service extension template.
Update and save the current domain.
Close the current domain.
Exit WLST
Disconnect WLST from the interactive session and close the scripting shell.

Each command is described in detail in the following sections. Commands are described alphabetically.

 


addTemplate

Extends the current domain using the specified application or service extension template.

Syntax

addTemplate(templateFileName)

Argument
Definition 
templateFileName
The name of the application or service extension template.

Examples

The following command extends the current domain using the specified extension template:

wls_offline:/> readDomain(`c:/bea/user_projects/domains/wlw')
wls_offline:/wlw> addTemplate('c:/bea/weblogic81/common/templates/
applications/wlp.jar')

 


closeDomain

Closes the current domain. The domain is no longer available for editing once it is closed.

Syntax

closeDomain()

Examples

The following command closes the current domain:

wls_offline:/> readDomain(`c:/bea/user_projects/domains/medrec')
...
wls_offline:/medrec> updateDomain()
wls_offline:/medrec> closeDomain()

 


closeTemplate

Closes the current domain template. The domain template is no longer available once it is closed.

Syntax

closeTemplate()

Examples

The following command closes the current domain template:

wls_offline:/> readTemplate(`c:/bea/weblogic81/common/templates/domains/
medrec.jar')
...
wls_offline:/medrec> writeDomain(`c:/bea/user_projects/domains/medrec')
wls_offline:/medrec> closeTemplate()

 


exit

Disconnects WLST from the user session and closes the scripting shell.

Syntax

exit()

Example

The following example instructs WLST to disconnect from the user session and close the scripting shell:

wls_offline:/> exit()
Exiting WLS scripting shell ...
c:\>

 


readDomain

Opens an existing domain for updating.

Syntax

readDomain(domainDirName)

Argument
Definition 
domainDirName
Specifies the directory name of the domain that you wish to open.

Example

The following command opens the specified domain for editing:

wls_offline:/> readDomain(`c:/bea/user_projects/domains/medrec')
wls_offline:/medrec>

 


readTemplate

Opens an existing domain template for domain creation.

Syntax

readTemplate(templateFileName)

Argument
Definition 
templateFileName
The name of the JAR file corresponding to the domain template.

Examples

The following command opens the specified domain template for domain creation:

wls_offline:/> readTemplate(`c:/bea/weblogic81/common/templates/domains
/medrec.jar')
wls_offline:/medrec>

 


updateDomain

Updates and saves the current domain. The domain continues to be editable after you update and save it.

Syntax

updateDomain()

Examples

The following command updates and saves the current domain:

wls_offline:/> readDomain(`c:/bea/user_projects/domains/medrec')
...
wls_offline:/medrec> updateDomain()

 


writeDomain

Writes the domain configuration information to the specified directory. The domain continues to be editable after you execute this 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.

Syntax

writeDomain(domainDir)

Argument
Definition 
domainDir
The name of the directory to which you want to write the domain configuration information.

Examples

The following command writes the domain configuration information to the specified directory:

wls_offline:/> readTemplate(`c:/bea/weblogic81/common/templates/domains
/medrec.jar')
...
wls_offline:/medrec> writeDomain(`c:/bea/user_projects/domains/medrec')

Browse Command (cd)

The cd command navigates the hierarchy of configuration objects. This command uses a model that is similar to navigating a file system in a Windows or UNIX command shell. You can navigate to configuration objects in the current hierarchy and to any child or instance.

To navigate back to a parent resource, enter the cd('..') command. To get back to the root configuration object after navigating to a resource that is deep in the hierarchy, enter the cd('/') command.

The cd command returns a stub of the configuration object instance, if one exists.

Note: The cmo variable is initialized to the root of all domain configuration objects. As you navigate, it is updated to the current configuration object.

Syntax

cd(path)

Argument
Definition 
path
Path to the configuration object in the namespace.

Example

The following example shows how to navigate the hierarchy of configuration objects:

wls_offline:/medrec> cd('Server')
wls_offline:/medrec/Server> cd('MedRecServer')
wls_offline:/medrec/Server/MedRecServer> cd('../..')
wls_offline:/medrec>

Edit Commands

Table 4 lists the WLST offline configuration Edit commands that you use to interrogate and edit configuration objects.

Table 4 Edit Commands for WLST Offline Configuration 
This command...
Enables you to...
For more information, see...
Assign configuration objects to one or more destinations.
Assign all applications or services to one or more destinations.
Create a child object with the specified name and type for the current configuration object.
Delete an instance of a child configuration with the specified name and type.
Return the value of the specified attribute for the current configuration object.
Load SQL files into a database.
Set the specified attribute value for the current configuration object.
Set options related to a domain creation or update
Unassign configuration objects from one or more destinations.
Unassign all applications or services from one or more destinations.

 


assign

Assigns configuration objects to one or more destinations.

Syntax

assign(sourceType, sourceName, destinationType, destinationName)

Argument
Definition 
sourceType
Type of configuration object to be assigned. This value can be set to Application, Server, or the name of a security type (such as User) or service (such as JDBCConnectionPool). Guidelines for setting this value are provided below.
sourceName
Name of the configuration object to be assigned. Multiple names must be separated by commas.
destinationType
Type of destination. Guidelines for setting this value are provided below.
destinationName
Name of the destination. Multiple names must be separated by commas.

Use the following guidelines for setting the sourceType and destinationType:

Example

The following example performs the following assignments:

 


assignAll

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.

Syntax

assignAll(sourceType, destinationType, destinationName)

Argument
Definition 
sourceType
Type of applications or services to be assigned. This value can be set to Applications or Services.
destinationType
Type of destination. This value must be set to Target.
destinationName
Name(s) of the destination. Multiple names must be separated by commas.

Example

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.

 


create

Creates a child object with the specified name and type for the current configuration object. The create command returns a stub for the newly created configuration object.

Note: Child types must be created under an instance of their parent type.

Syntax

create(Name,childObjectType)

Argument
Definition 
Name
Name for the configuration object that you are creating.
childObjectType
Type of child object that you are creating for the current configuration object. You can create instances of any type defined in the config.xml file except custom security types.

Example

The following example creates a child object of type Server named newServer for the current configuration object, storing the stub as server1:

wls_offline:/medrec> server1=create('newServer','Server')
wls_offline:/medrec> server1.getName()
`newServer'

 


delete

Deletes an instance of a child object with the specified name and type for the current configuration object.

Syntax

delete(Name,childObjectType)

Argument
Definition 
Name
Name of the child object to delete for the current configuration object.
childObjectType
Type of the child object to be deleted. You can delete instances of any type defined in the config.xml file.

Example

The following example deletes the child object of type Server named newServer for the current configuration object:

wls_offline:/medrec> delete('newServer','Server')

 


get

Returns the value of the specified attribute for the current configuration object.

Note: You can list all attributes and their current values using the a argument to the ls command. For more information, see ls.

Alternatively, you use the cmo variable to perform any get method on the current configuration object. For example:

cmo.getListenPort()

For more information about the cmo variable, see WLST Offline Configuration Variables.

Syntax

get(attributeName)

Argument
Definition 
attributeName
Name of the attribute to be displayed.

Example

The following example returns the value of the AdministrationPort for the current configuration object:

wls_offline:/medrec> get('AdministrationPort')
9002

 


loadDB

Loads SQL files into a database.

Before executing this command, ensure that the following conditions are true:

The command fails if the above conditions are not met.

Syntax

loadDB(DBVersion, connectionPoolName)

Argument
Definition 
DBVersion
Version of the database for which the SQL files are intended to be used.
ConnectionPoolName
Name of the JDBC connection pool to be used to load SQL files.

Example

The following example loads SQL files, intended for version 4.4 of the database, using the myPool-PointBase JDBC connection pool:

wls_offline:/mydomain> loadDB(`4.4', `myPool-PointBase')

 


set

Sets the specified attribute value for the current configuration object.

Note: You can list all attributes and their current values using the a argument to the ls command. For more information, see ls.

When you use offline WLST to set password attributes, you need to use the encrypted attribute. For example, to update CustomIdentityKeyStorePassPhrase, you have to use the CustomIdentityKeyStorePassPhraseEncrypted attribute. In this example, if you do not use the encrypted attribute, the "Unable to find attribute CustomIdentityKeyStorePassPhrase" message appears.

Alternatively, you use the cmo variable to perform any set method on the current configuration object. For example:

cmo.setPassword(`weblogic')

For more information about the cmo variable, see WLST Offline Configuration Variables.

Syntax

set(attributeName,attributeValue)

Argument
Definition 
attributeName
Name of the attribute to be set.
attributeValue
Value of the attribute to be set.
This value does not need to be enclosed in single or double quotes are required.

Example

The following example sets the ArchiveConfigurationCount attribute of DomainMBean to 10:

wls_offline:/mydomain/config> set('ArchiveConfigurationCount',10)
wls_offline:/mydomain/config>

 


setOption

Sets options related to a domain creation or update.

Syntax

setOption(optionName,optionValue)

Argument
Definition 
optionName
Name of the option to set.
Available options for domain creation include:
  • CreateStartMenu—specifies whether to create a Start Menu shortcut on a Windows platform.
  • JavaHome—specifies the home directory for the JVM to be used when starting the server.
  • OverwriteDomain—specifies whether to allow an existing domain to be overwritten. The default is false.
  • ServerStartMode—specifies the mode to use when starting the server for the newly created domain. This value can be dev (development) or prod (production).
Available options for domain updates include:
  • AllowCasualUpdate—specifies whether allow a domain to be updated without adding an extension template. The default is true.
  • ReplaceDuplicates—specifies whether to keep original configuration elements in the domain or replace the elements with corresponding ones from an extension template when there is a conflict.
Available options for both domain creation and domain updates include:
  • AppDir—specifies the application directory to be used when a separate directory is desired for applications, as specified by the template.
  • AutoDeploy—specifies whether to activate auto deployment when a cluster or multiple Managed Servers are created. This option defaults to true. To deactivate this feature, set the option to `False' on the first line of your script.
optionValue
Value for the option.

Example

The following example sets the CreateStartMenu option to false:

wls_offline:/> setOption('CreateStartMenu', 'false')

 


unassign

Unassign configuration objects from one or more destinations.

Syntax

unassign(sourceType, sourceName, destinationType, destinationName)

Argument
Definition 
sourceType
Type of configuration object to be unassigned. This value can be set to Application, Server, or the name of a security type (such as User) or service (such as JDBCConnectionPool). Guidelines for setting this value are provided below.
sourceName
Name of the configuration object to be unassigned. Multiple names must be separated by commas.
destinationType
Type of destination. Guidelines for setting this value are provided below.
destinationName
Name of the destination. Multiple names must be separated by commas.

Use the following guidelines for setting the sourceType and destinationType:

Example

The following example unassigns the following resources:

 


unassignAll

Unassigns all applications or services from one or more destinations.

Syntax

unassignAll(sourceType, destinationType, destinationName)

Argument
Definition 
sourceType
Type of applications or services to be unassigned. This value can be set to Applications or Services.
destinationType
Type of destination. This value must be set to `Target'.
destinationName
Name(s) of the destination. Multiple names must be separated by commas.

Example

The following example unassigns all services from the servers adminServer and cluster1.

wls_offline:/medrec> unassignAll("Services", "Target", "adminServer,cluster1")

The following services, if present, are unassigned from the specified targets: MigratableRMIService, Shutdownclass, Startupclass, FileT3, RMCFactory, MailSession, MessagingBridge, JMSConnectionFactory, JDBCConnectionPool, JDBCMultipool, JDBCTxDatasource, JDBCDataSource, JDBCPoolComp, JoltConnectionPool, WLECConnectionPool, and WTCServer.

Information Commands

Table 5 lists the information commands for WLST offline configuration that are useful for interrogating domains, servers, and variables, and providing configuration object and WLST-related information.

Table 5 Information Commands for WLST Offline Configuration 
This command...
Enables you to...
For more information, see...
Display any stack trace that was produced while performing a WLST action.
Display all variables used by WLST, including their name and value.
Provide syntax and usage information for all categories of WLST commands, when no arguments are specified, or for a single command, when a command or variable name argument is specified.
List all child objects or attributes for the current configuration object.
Toggle the display of the configuration object navigation path information at the prompt, when entered without an argument.
Display the current location in the hierarchy of the configuration tree.
Record all user interactions with WLST; useful for capturing commands.
Stop recording WLST commands.

Each command is described in detail in the following sections.

 


dumpStack

Displays any stack trace that was produced while performing a WLST action.

Syntax

dumpStack()

Example

This example instructs WLST to display the stack trace.

wls_offline:/medrec> dumpStack()
com.bea.plateng.domain.script.jython.WLSTException: java.lang.reflect.Invocation TargetException
...

 


dumpVariables

Displays all the variables used by WLST, including their name and value.

Syntax

dumpVariables()

Example

This example instructs WLST to display all the current variables and their values.

wls_offline:/platform>dumpVariables()
cmo: Proxy for medrec: Name=medrec, Type=DomainConfig
exitonerror: true
isrecording: false

 


help

Provides syntax and usage information for all categories of WLST commands, when no arguments are specified, or for a single command or variable, when a command or variable name argument is specified.

The help command will support a query; for example, help('get*') displays the syntax and usage information for all commands that begin with get.

Syntax

help([`name'])

Argument
Definition 
name
Optional. Command or variable name for which information is requested.

Example

In the following example, information about using the get command is requested:

wls:/medrec> help('get')

The command returns the following:

Description: 
Get any attribute for the currently navigated configuration object.
Syntax:
get(AttributeName)
AttributeName = current configuration object's attribute name.
Example:
wls_offline:/medrec/Server/MedRecServer>get('AcceptBacklog')
50
wls_offline:/medrec/Server/MedRecServer>

 


ls

Lists all the child objects or attributes for current configuration object.

You can optionally control the output by specifying an optional argument.

Table 6 describes the ls command output information.

Table 6 ls Command Output Information 
Output
Definition 
d
A configuration object with which you can use the cd command; analogous to a directory in a UNIX or Windows file system.
r
Readable property.
w
Writeable property.
x
Executable operation.

Syntax

ls(['a' | 'c'])

Argument
Definition 
a
Optional. Display all the attribute names and values for the current configuration object. If the attribute is encrypted, WLST displays six asterisks (******).
c
Optional. Display all the child objects that are contained in the current configuration object. This argument is the default.

Example

The following command displays the child objects for the current configuration object:

wls_offline:/medrec> ls()
drw- Application
drw- Cluster
drw- FileRealm
drw- JDBCConnectionPool
drw- JDBCTxDataSource
drw- JMSConnectionFactory
drw- MailSession
drw- PasswordPolicy
drw- Realm
drw- Security
drw- Server

The following command displays all the attribute names and values for the current configuration object:

wls_offline:/medrec> ls('a')
-rw- AdministrationPort 9002
-rw- AdministrationPortEnabled false
-rw- AutoConfigurationSaveEnabled false
-rw- ConfigurationVersion 8.1.2.0
-rw- ConsoleContextPath console
-rw- ConsoleEnabled true
-rw- LastModificationTime 0
-rw- Name medrec
-rw- Notes null
-rw- ProductionModeEnabled false
wls_offline:/medrec>

 


prompt

Toggles the display of the configuration object navigation 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 configuration object navigation path. For WLST offline configuration, when you disable the prompt details, the prompt displays as follows: wls_offline:/>. In this case, to determine your current location in the hierarchy, you can use the pwd command, as described in pwd. By default, the WLST prompt displays the configuration object navigation path information.

Syntax

prompt([`off'|'on'])

Argument
Definition 
`off' | `on'
Optional. Hides or displays WLST prompt, as follows:
  • The off argument hides the WLST prompt and defaults to the Jython prompt. You can create a new prompt using Jython syntax.
  • The on argument displays the default prompt, including the configuration object navigation path information.

Example

The following example instructs WLST to hide and redisplay the configuration object navigation path information at the prompt:

wls_offline:/medrec/Server/MedRecServer> prompt()
wls_offline:/>
wls_offline:/> prompt()
wls_offline:/medrec/Server/MedRecServer

The following example instructs WLST to hide the prompt and default to the Jython prompt, change the Jython prompt, and redisplay the WLST prompt:

wls_offline:/medrec/Server/MedRecServer> prompt('off')
>>>
>>>sys.ps1="myprompt>"
myprompt>
myprompt> prompt('on')
wls:/medrec/Server/MedRecServerfs>

 


pwd

Displays the current location in the hierarchy of the configuration tree.

Syntax

pwd()

Example

The following command displays the current location in the hierarchy of the configuration object:

wls_offline:/medrec> pwd()
/medrec

 


startRecording

Records all user interactions with WLST; useful for capturing commands.

Syntax

startRecording(recordFilePath)

Argument
Definition 
recordFilePath
File pathname for storing WLST commands.

Example

The following example instructs WLST to begin recording WLST commands in the record.py file:

wls_offline:/> startRecording(`c:/myScripts/record.py')
Starting recording to c:\myScripts\record.py

 


stopRecording

Stops recording WLST commands.

Syntax

stopRecording()

Example

The following example instructs WLST to stop recording WLST commands:

wls_offline:/> stopRecording()
Stopping recording to c:\myScripts\record.py

  Back to Top       Previous  Next