} }

 Files   Prepare   Run   Troubleshooting   Related Topics 

 

About the Example

These examples show how to use the WebLogic Scripting Tool (WLST) to configure and manage WebLogic Server® instances and domains while connected to a running WebLogic Administration Server.


 

Files Used in the Example

Directory Location:

MW_HOME/wlserver_10.3/samples/server/examples/src/examples/wlst/online/

(where MW_HOME is the directory containing your WebLogic Server installation)

File

Click source files to view code.

Description

build.xml Ant build file that contains targets for building and running the example.
cluster_creation.py Connects WLST to an Administration Server, starts an edit session, and creates 10 Managed Servers. Then creates two clusters, assigns servers to each cluster, and disconnects WLST from the server.
cluster_deletion.py Removes the clusters and servers created in cluster_creation.py.
jdbc_data_source_creation.py Connects WLST to an Administration Server, starts an edit session, and creates a JDBC data source called myJDBCDataSource.
jdbc_data_source_deletion.py Removes the JDBC data source created by jdbc_data_source_creation.py.
configJMSSystemResource.py Connects WLST to an Administration Server, starts an edit session, creates two JMS Servers, and targets them to the Administration Server. Then creates JMS topics, JMS queues, and JMS templates in a JMS System module. The JMS queues and topics are targeted using sub-deployments.
deleteJMSSystemResource.py Removes the JMS System module created by configJMSSystemResource.py.

 

Prepare the Example

 

Prerequisites

Before working with this example:

  1. Install WebLogic Server, including the examples.
  2. Start the Examples server.

 

Configure WebLogic Server

  No special configuration is required for this example.

 

Build and Deploy the Example

There are no build and deploy instructions for this example.


 

Run the Example

There are two scripts, a creation and a deletion script, for each example scenario. First run the creation script and then the deletion script.

To run the examples, follow these steps:

  1. Open a command window and set up your development shell as described in Setting Up Your Environment.
  2. Change to the SAMPLES_HOME\server\examples\src\examples\wlst\online directory, where SAMPLES_HOME refers to the main WebLogic Server examples directory, such as c:\Oracle\Middleware\wlserver_10.3\samples.
  3. Run all the examples by executing the Ant utility at the command line:
    prompt> ant
    

    Alternatively, you can execute the scripts one at a time from the WLST shell (Steps 4-7):

  4. Invoke WLST by entering the following command:
    prompt> java weblogic.WLST
    A welcome message and the WLST prompt appears:
    Initializing WebLogic Scripting Tool (WLST) ...
      
    
    Welcome to WebLogic Server Administration Scripting Shell
    Type help() for help on available commands
    wls:/offline>
  5. Run the cluster creation script by entering the following command:

    wls:/offline> execfile('cluster_creation.py')

    The servers and clusters are created.

  6. Run the cluster deletion script to remove the servers and clusters:

    wls:/offline> execfile('cluster_deletion.py')

    You have successfully run the WLST cluster examples.

  7. Run the other WLST examples in a similar manner, using the execfile command with the creation script file name and then deletion.

     

    Check the Output

    If the Ant example runs successfully, you will get the following message in the command shell from which you ran the client application:

    Buildfile: build.xml

    run:cluster.creation
    ...

    BUILD SUCCESSFUL
    Total time: 1 minute 17 seconds


 

Troubleshooting


 

Related Topics

(Internet connection required.)