The WebSphere Application Server wsadmin
tool provides the ability to execute scripts. You can use the wsadmin tool
to manage a WebSphere Application Server V5.0 installation. This tool uses
the Bean Scripting Framework (BSF), which supports a variety of scripting
languages to configure and control your WebSphere Application Server installation.
The WebSphere Application Server only supports the Jacl scripting language.
The wsadmin launcher makes Java objects available through language-specific interfaces. Scripts use these objects for application management, configuration, operational control, and for communication with MBeans running in WebSphere server processes.
Syntax
The command-line invocation syntax for the wsadmin scripting client follows:
wsadmin [-h(help)] [-?] [-c <commands>] [-p <properties_file_name>] [-profile <profile_script_name>] [-f <script_file_name>] [-javaoption java_option] [-lang language] [-wsadmin_classpath classpath] [-conntype SOAP [-host host_name] [-port port_number] [-user userid] [-password password] | RMI [-host host_name] [-port port_number] [-user userid] [-password password] | NONE ] [script parameters]
Where script parameters represent any arguments other than the ones listed previously. The argc variable contains their number, and the argv variable contains their contents.
Options
If you invoke the wsadmin tool with the -c option, any changes that you make to the configuration will be saved automatically. If you make configuration changes and you are not using the -c option, you must use the save command of the AdminConfig object to save the changes. See the Saving configuration changes with the wsadmin tool article for more information.
Only one -f option can exist on the command line.
Multiple -javaoption options can exist on the command line.
This argument is required if not determined from the script file name. It overrides language determinations that are based on a script file name, or the com.ibm.ws.scripting.defaultLang property. There is no default value for the -lang argument. If the command line or the property does not supply the script language, and the wsadmin tool cannot determine it, an error message generates.
The file listed after -p, represents a Java properties file that the scripting process reads. Three levels of default properties files load before the properties file you specify on the command line. The first level is the installation default, wsadmin.properties, located in the WebSphere Application Server properties directory. The second level is the user default, wsadmin.properties, located in your home directory. The third level is the properties file pointed to by the environment variable WSADMIN_PROPERTIES.
Multiple -p options can exist on the command line. They invoke in the order that you supply them.
The profile script runs before other commands, or scripts. If you specify -c, the profile executes before it invokes this command. If you specify -f, the profile executes before it runs the script. In interactive mode, you can use the profile to perform any standard initialization that you want. You can specify multiple -profile options on the command line, and they invoke in the order that you supply them.
This argument consists of a string that determines the type, for example, SOAP, and the options that are specific to that connection type. Possible types include: SOAP, RMI, and NONE.
The options for -conntype include: SOAP, RMI, and NONE.
Use the -conntype NONE option to run in local mode. The result is that the scripting client is not connected to a running server.
Follow this option with a class path string. For example:
c:/MyDir/Myjar.jar;d:/yourdir/yourdir.jarThe class path is then added to the class loader for the scripting process.
You can also specify this option in a properties file that is used by the wsadmin tool. The property is com.ibm.ws.scripting.classpath. If you specify -wsadmin_classpath on the command line, the value of this property overrides any value specified in a properties file. The class path property and the command-line options are not concatenated.
Example
In the following syntax examples, mymachine is the name of the host in the wsadmin.properties file, specified by the com.ibm.ws.scripting.port property:
wsadmin -f test1.jacl -profile setup.jacl -conntype SOAP -host mymachine
wsadmin -javaoption -Xms128m -javaoption -Xmx256m -f test.jacl
wsadmin -conntype RMI -port rmiportnumber -user userid -password password
wsadmin -conntype NONE -c "$AdminApp uninstall app"