WebLogic Scripting Tool
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
WLST enables you to create a new domain or update an existing domain without connecting to a running WebLogic Server (that is, using WLST offline)—supporting the same functionality as the Configuration Wizard.
You can create new configuration information, and retrieve and change existing configuration information that is persisted in the domain configuration files (located in the config
directory, for example, config.xml
) or in a domain template JAR created using Template Builder.
The following sections describe how to create and configure WebLogic domains using WLST offline. Topics include:
For more information about the Configuration Wizard, see Creating WebLogic Domains Using the Configuration Wizard.
Notes: Before creating or updating a domain, you must set up your environment and invoke WLST, as described in Main Steps for Using WLST. You can exit WLST at anytime using the exit
command, as follows: exit()
When using the Configuration Wizard or WLST Offline to create or extend a clustered domain with a template that has applications containing application-scoped JDBC and/or JMS resources, you may need to perform additional steps (after the domain is created or extended) to make sure that the application and its application-scoped resources are targeted and deployed properly in a clustered environment. For more information on the targeting and deployment of application-scoped modules, see "Deploying Applications and Modules" in Deploying Applications to WebLogic Server at http://download.oracle.com/docs/cd/E13222_01/wls/docs90/deployment/deploy.html
.
To create a domain using WLST offline, perform the steps defined in the following table.
Note: Because WLST offline enables you to access and update the configuration objects that appear in the configuration files only, if you wish to view and/or change attribute values for a configuration object that is not already persisted in the configuration files as an XML element, you must first create the configuration object. For more information, see create. |
Browsing and Accessing Information About the Configuration Bean Hierarchy (Offline) |
||
Set the password for the default user, if it is not already set Note: The default username and password must be set before you can write the domain. |
|
Stepping Through a Sample Script: Creating a Domain Using WLST Offline |
|
Write the domain configuration information to the specified directory |
|||
To update an existing domain using WLST offline, you perform the steps defined in the following table.
Note: Because WLST offline enables you to access and update the configuration objects that appear in the configuration files only, if you wish to view and/or change attribute values for a configuration object that is not already persisted in the configuration files as an XML element, you must first create the configuration object. For more information, see create. |
Browsing and Accessing Information About the Configuration Bean Hierarchy (Offline) |
||
To browse and access information about the configuration bean hierarchy using WLST offline, you can perform any of the tasks defined in the following table.
Note: Because WLST offline enables you to access and update the configuration objects that appear in the configuration files only, if you wish to view and/or change attribute values for a configuration object that is not already persisted in the configuration files as an XML element, you must first create the configuration object.
To edit a domain using WLST offline, you can perform any of the tasks defined in the following table.
Note: Because WLST offline enables you to access and update the configuration objects that appear in the configuration files only, if you wish to view and/or change attribute values for a configuration object that is not already persisted in the configuration files as an XML element, you must first create the configuration object.
http://download.oracle.com/docs/cd/E13222_01/wls/docs90/jmx/understandWLS.html
.http://download.oracle.com/docs/cd/E13222_01/wls/docs90/wlsmbeanref/core/index.html
.
|
||
|
||
To create a domain template using WLST offline, perform the steps described in the following table.
Set the password for the default user, if it is not already set Note: The default username and password must be set before you can write the domain template. |
|
Stepping Through a Sample Script: Creating a Domain Using WLST Offline |
|
Write the domain configuration information to a domain template |
To export diagnostic information using WLST offline, use the exportDiagnosticData
command defined in the following table.
The results are saved to an XML file. For more information about the WebLogic Server Diagnostic Service, see Understanding the WebLogic Diagnostic Service at http://download.oracle.com/docs/cd/E13222_01/wls/docs90/wldf_understanding/index.html
.
The following example steps through a sample script that creates a WebLogic domain using the Basic WebLogic Server Domain template. The sample script demonstrates how to open a domain template; create and edit configuration objects; write the domain configuration information to the specified directory; and close the domain template.
The script shown is installed with your product at WL_HOME
\common\templates\scripts\wlst\basicWLSDomain.py
, where WL_HOME
refers to the top-level installation directory for WebLogic Server. See also WLST Offline Sample Scripts for a description of the full set of sample scripts that are installed with your product.
To create a WebLogic domain using the Basic WebLogic Server Domain template:
c:/bea/weblogic90
). In this example, we open the Basic WebLogic Server Domain template.readTemplate('c:/bea/weblogic90/common/templates/domains/wls.jar')
Note: When you open a template or domain, WLST is placed into the configuration bean hierarchy for that domain, and the prompt is updated to reflect the current location in the configuration hierarchy. For example:
WebLogic Server configuration beans exist within a hierarchical structure. Similar to a file system, the hierarchies correspond to drives; types and instances are directories; attributes and operations are files. WLST traverses the hierarchical structure of configuration beans using commands such as cd
, ls
, and pwd
in a similar way that you would navigate a file system in a UNIX or Windows command shell. After navigating to an configuration bean instance, you interact with the bean using WLST commands. For more information, see Navigating and Interrogating MBeans.
cd('Servers/AdminServer')
set('ListenAddress','')
set('ListenPort', 7001)
create('AdminServer','SSL')
cd('SSL/AdminServer')
set('Enabled', 'True')
set('ListenPort', 7002)
cd('/')
cd('Security/base_domain/User/weblogic')
cmo.setPassword('weblogic')
cd('/')
create('myJMSServer', 'JMSServer')
cd('/')
create('myJmsSystemResource', 'JMSSystemResource')
cd('JMSSystemResource/myJmsSystemResource/JmsResource/NO_NAME_0')
myq=create('myQueue','Queue')
myq.setJNDIName('jms/myqueue')
myq.setSubDeploymentName('myQueueSubDeployment')
cd('/')
cd('JMSSystemResource/myJmsSystemResource')
create('myQueueSubDeployment', 'SubDeployment')
cd('/')
create('myDataSource', 'JDBCSystemResource')
cd('JDBCSystemResource/myDataSource/JdbcResource/myDataSource')
create('myJdbcDriverParams','JDBCDriverParams')
cd('JDBCDriverParams/NO_NAME_0')
set('DriverName','com.pointbase.jdbc.jdbcUniversalDriver')
set('URL','jdbc:pointbase:server://localhost/demo')
set('PasswordEncrypted', 'PBPUBLIC')
set('UseXADataSourceInterface', 'false')
create('myProps','Properties')
cd('Properties/NO_NAME_0')
create('user', 'Property')
cd('Property/user')
cmo.setValue('PBPUBLIC')
cd('/JDBCSystemResource/myDataSource/JdbcResource/myDataSource')
create('myJdbcDataSourceParams','JDBCDataSourceParams')
cd('JDBCDataSourceParams/NO_NAME_0')
set('JNDIName', java.lang.String("myDataSource_jndi"))
cd('/JDBCSystemResource/myDataSource/JdbcResource/myDataSource')
create('myJdbcConnectionPoolParams','JDBCConnectionPoolParams')
cd('JDBCConnectionPoolParams/NO_NAME_0')
set('TestTableName','SYSTABLES')
cd('/')
assign('JMSServer', 'myJMSServer', 'Target', 'AdminServer')
assign('JMSSystemResource.SubDeployment', 'myJmsSystemResource.myQueueSubDeployment', 'Target', 'myJMSServer')
assign('JDBCSystemResource', 'myDataSource', 'Target', 'AdminServer')
setOption('OverwriteDomain', 'true')
writeDomain('c:/bea/user_projects/domains/wls_testscript')
closeTemplate()
exit()
![]() ![]() |
![]() |
![]() |