Installing enterprise applications using wsadmin scripting

Use the AdminApp object or the AdminApplication script library to install an application to the application server run time. You can install an enterprise archive file (EAR), Web archive (WAR) file, servlet archive (SAR), or Java™ archive (JAR) file.

Before you begin

On a single server installation, verify that the server is running before you install an application. Use the startServer command utility to start the server.

There are two ways to complete this task. Complete the steps in this topic to use the AdminApp object to install enterprise applications. Alternatively, you can use the scripts in the AdminApplication script library to install, uninstall, and administer your application configurations.

The scripting library provides a set of procedures to automate the most common administration functions. You can run each script procedure individually, or combine several procedures to quickly develop new scripts.

About this task

Use this topic to install an application from an enterprise archive file (EAR), a Web archive (WAR) file, a servlet archive (SAR), or a Java archive (JAR) file. The archive file must end in .ear, .jar, .sar or .war for the wsadmin tool to complete the installation. The wsadmin tool uses these extensions to determine the archive type. The wsadmin tool automatically wraps WAR and JAR files as an EAR file.

Best practice: Use the most recent product version of the wsadmin tool when installing applications to mixed-version environments to ensure that the most recent wsadmin options and commands are available. bprac

Procedure

  1. Start the wsadmin scripting tool.
  2. Determine which options to use to install the application in your configuration.

    For example, if your configuration consists of a node, a cell, and a server, you can specify that information when you enter the install command. Review the list of valid options for the install and installinteractive commands in the Options for the AdminApp object install, installInteractive, edit, editInteractive, update, and updateInteractive commands using wsadmin scripting topic to locate the correct syntax for the -node, -cell, and -server options. For this configuration, use the following command examples:

    Using Jython:
    AdminApp.install('location_of_ear.ear','[-node nodeName -cell cellName -server serverName]')
    Using Jacl:
    $AdminApp install "location_of_ear.ear" {-node nodeName -cell cellName -server serverName}

    You can also obtain a list of supported options for an enterprise archive (EAR) file using the options command, for example:

    Using Jython:
    print AdminApp.options()
    Using Jacl:
    $AdminApp options

    [jun2010] You can set or update a configuration value using options in batch mode. To identify which configuration object is to be set or updated, the values of read only fields are used to find the corresponding configuration object. All the values of read only fields have to match with an existing configuration object, otherwise the command fails. [jun2010]

    jun2010

    [jun2010] You can use pattern matching to simplify the task of supplying required values for certain complex options. Pattern matching only applies to fields that are required or read only. [jun2010]

    jun2010

  3. Choose to use the install or installInteractive command to install the application.

    You can install the application in batch mode, using the install command, or you can install the application in interactive mode using the installinteractive command. Interactive mode prompts you through a series of tasks to provide information. Both the install command and the installinteractive command support the set of options you chose to use for your installation in the previous step.

  4. Install the application. For this example, only the server option is used with the install command, where the value of the server option is serv2. Customize your install or installInteractive command with on the options you chose based on your configuration.
    • Using the install command to install the application in batch mode:
      • For a single server installation only, the following example uses the EAR file and the command option information to install the application:
        • Using Jython string:

          AdminApp.install('c:/MyStuff/application1.ear', '[-server serv2]')
        • Using Jython list:

          AdminApp.install('c:/MyStuff/application1.ear', ['-server', 'serv2'])
        • Using Jacl:

          $AdminApp install "c:/MyStuff/application1.ear" {-server serv2}
        Table 1. install server command elements. Run the install command with the -server option.
        $ is a Jacl operator for substituting a variable name with its value
        AdminApp is an object supporting application object management
        install is an AdminApp command
        MyStuff/application1.ear is the name of the application to install
        server is an installation option
        serv2 is the value of the server option
    • Use the installInteractive command to install the application using interactive mode. The following command changes the application information by prompting you through a series of installation tasks:
      • Using Jython:

        AdminApp.installInteractive('c:/MyStuff/application1.ear')
      • Using Jacl:

        $AdminApp installInteractive "c:/MyStuff/application1.ear"
      Table 2. installInteractive command elements. Run the installInteractive command with the -name of the application to install.
      $ is a Jacl operator for substituting a variable name with its value
      AdminApp is an object allowing application objects to be managed
      installInteractive is an AdminApp command
      MyStuff/application1.ear is the name of the application to install
  5. Save the configuration changes.
    Use the following command example to save your configuration changes:
    AdminConfig.save()

What to do next

The steps in this task return a success message if the system successfully installs the application. When installing large applications, the command might return a success message before the system extracts each binary file. You cannot start the application until the system extracts all binary files. If you installed a large application, use the isAppReady and getDeployStatus commands for the AdminApp object to verify that the system extracted the binary files before starting the application.

The isAppReady command returns a value of true if the system is ready to start the application, or a value of false if the system is not ready to start the application. For example, using Jython:
print AdminApp.isAppReady('application1')
Using Jacl:
$AdminApp isAppReady application1

If the system is not ready to start the application, the system might be expanding application binaries. Use the getDeployStatus command to display additional information about the binary file expansion status, as the following examples display:

Using Jython:
print AdminApp.getDeployStatus('application1')
Using Jacl:
$AdminApp getDeployStatus application1

Running the getDeployStatus command where application1 is DefaultApplication results in status information about DefaultApplication resembling the following:

ADMA5071I: Distribution status check started for application DefaultApplication.
WebSphere:cell=myCell01,node=myNode01,distribution=unknown,expansion=unknown
ADMA5011I: The cleanup of the temp directory for application DefaultApplication is complete.
ADMA5072I: Distribution status check completed for application DefaultApplication.
WebSphere:cell=myCell01,node=myNode01,distribution=unknown,expansion=unknown



In this information ...


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic    

Terms of Use | Feedback

Last updated: Oct 21, 2010 1:44:59 AM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=compass&product=was-express-dist&topic=txml_callappinstall
File name: txml_callappinstall.html