WLST - Getting Started (Hello World)

Card Puncher Data Processing


The execution of a Wlst Script can happen in the following three modes:

  • interactive: on the command line
  • scripting: in batch scripts that are supplied in a file (Script Mode, where scripts invoke a sequence of WLST commands without requiring your input)
  • embedded: in Java code.

How to

start the WLST console

From a shell with Java

  • Environment Configuration
Environment variable Path
CLASSPATH WebLogic Server classes
PATH WL_HOME\server\bin

Script to set both variables:

  • Windows: WL_HOME\server\bin\setWLSEnv.cmd
  • Linux: WL_HOME\server\bin\setWLSEnv.sh
  • Invoking the console Console
   [ -Dweblogic.security.SSL.ignoreHostnameVerification=true -Dweblogic.security.TrustKeyStore=DemoTrust ]
   [ -loadProperties propertyFilename ]
   [ -skipWLSModuleScanning ]
   [ [-i] filePath.py ]


  • the first parameter is for a SSL connection
  • the second option is to load a property file
  • -skipWLSModuleScanning is to reduce startup time by skipping package scanning and caching for WLS modules
  • -i prevent WLST from exiting after the script is executed
  • filePath.py is a script


C:\Oracle\Middleware1035\wlserver_10.3\server\bin>java weblogic.WLST
Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands


From a shell script

This wlst.cmd:


calls this one:


From Windows Start Menu: Weblogic Scripting Tool

Weblogic Scripting Tool Windows Menu

From Eclipse

Eclipse Wlst Console Start

Start an “Hello World” script

The script:

import sys

if len(sys.argv) > 1:
    print sys.argv[1]+" from the console" 
    print "Hello World from the script"

From the shell

java weblogic.WLST HelloWorld.py "Hello World"
Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

Hello World from the console

From Eclipse

Eclipse Wlst Hello World

From the WLST console

import sys
sys.argv = ['Hello World', 'arg2']

From Ant

<property name="wls.lib.dir" location="C:/Oracle/Middleware1035/wlserver_10.3/server/lib" />
<path id="wls.classpath.id">
    <pathelement location="${wls.lib.dir}/weblogic.jar" />
<taskdef name="wlst" classname="weblogic.ant.taskdefs.management.WLSTTask" classpathref="wls.classpath.id" />
<target name="WlsHelloWorld">
    <wlst fileName="helloworld.py" classpathref="wls.classpath.id" arguments="'Hello World'"/>
ant WlsHelloWorld
Buildfile: D:\HelloWorld\build.xml

     [wlst] 'Hello from the console

Total time: 3 seconds


taskdef class weblogic.ant.taskdefs.management.WLSTTask cannot be found

taskdef class weblogic.ant.taskdefs.management.WLSTTask cannot be found
 using the classloader AntClassLoader[]

The classpath element must be added to the taskdef.

<taskdef name="wlst" classname="weblogic.ant.taskdefs.management.WLSTTask" classpathref="wls.classpath.id"/>

Documentation / Reference

Discover More
Card Puncher Data Processing
Weblogic Scripting Tool (WLST)

The Oracle is a scripting tool for monitoring, managing, and configuring Oracle WebLogic Server from the command line and then for instance enables you to programmatically administer application such...

Share this page:
Follow us:
Task Runner