Launch wsadmin.sh

 


Interactively

To run wsadmin.sh interactively:

wsadmin.sh -username system \
           -password password

From the interactive shell one can enter any Jacl commands or commands against AdminControl, AdminApp, AdminConfig, or Help. For example:

WASX7209I: Connected...
           The type of process is: UnManagedProcess
WASX7029I: For help, enter: "$Help help"
wsadmin>$AdminApp list
adminconsole
DefaultApplication
ivtApp
wsadmin>exit

To leave an interactive scripting session, use the quit or exit commands.

 


Individual Commands

To run wsadmin.sh against a single jacl command:

wsadmin.sh -username system \
           -password password \
           -c "\$AdminApp list"

or

wsadmin.sh -username system \
           -password password \
           -c '$AdminApp list'

Example output:

WASX7209I: Connected...
The type of process is: UnManagedProcess
adminconsole
DefaultApplication
ivtApp

 


Scripts

To run wsadmin.sh against a script file containing multiple jacl commands:

wsadmin -username system \
        -password password \
        -f filename.jacl

where the filename.jacl file contains:

set apps [$AdminApp list]
puts $apps

Example output:

WASX7209I: Connected... 
The  type of process is: UnManagedProcess
 adminconsole
 DefaultApplication
 ivtApp

 


Example Commands

 

Print to stdout

puts stdout {Hello, world!}

 

List all applications

set xlist [$AdminApp list]
puts $xlist

 

List AdminApp options

set xhelp [$Help AdminApp]
puts $xhelp

 

List AdminConfig options

set xhelp [$Help AdminConfig]
puts $xhelp

 

List AdminControl options

set xhelp [$Help AdminControl]
puts $xhelp

 

List configuration objects

set xconfig [$AdminConfig list Server]
puts $xconfig

 

List all available JDBC templates

set ojdbc [$AdminConfig listTemplates JDBCProvider]
puts $ojdbc

 

List Oracle JDBC templates

set xoracle [$AdminConfig listTemplates JDBCProvider Oracle]
puts $xoracle
set xoracle1 [lindex $xoracle 0]
set xoracle2 [$AdminConfig show $xoracle1]
puts $xoracle2

 

List Server templates

set servert [$AdminConfig listTemplates Server]
puts $servert

 

List options for an ear file

set xoptions [$AdminApp options /usr/local/wsdev3/filename.ear]
puts $xoptions

 

Get description of an option

set xoptions [$AdminApp help optionname]
puts $xoptions

 

Get BindJndiForEJBNonMessageBinding info

set xtaskInfo [$AdminApp taskInfo /usr/local/wsdev3/filename.ear BindJndiForEJBNonMessageBinding] puts $xtaskInfo

 

Update an application

set app_options "-appname appname -update"
puts "app_options = $app_options"
$AdminApp install $earName $app_options

 


Run Jacl commands from a profile

A profile is a script that runs before the main script, or before entering interactive mode. One can use profiles to set up a scripting environment customized for the user or the installation.

To run scripting commands in a profile, execute the wsadmin tool with the -profile option, and place the commands you want to execute into the profile. For example:

wsadmin.sh -profile alprof.jacl

where the alprof.jacl file contains the following commands:

set apps [$AdminApp list]
puts "Applications currently installed:\n$apps"

Example output:

WASX7209I: Connected...
The type of process is: UnManagedProcess
 Applications currently installed:
 adminconsole
 DefaultApplication
 ivtApp
 WASX7029I: For help, enter: "$Help help"
 wsadmin>