Install applications using wsadmin.sh

 

Jacl Examples

### Use an EAR file to install the application...
$AdminApp install /path/to/appname.ear {-server servername}

### Change the application information by
### prompting you through a series of installation tasks...
$AdminApp installInteractive /path/to/appname.ear

### To install the application on a cluster...
$AdminApp install /path/to/appname.ear {-cluster cluster1}

$AdminConfig save

 

Create an install script using Jacl interactive

You can use the installInteractive option to generate the code necessary to install an application.

  1. Install app using installInteractive, capturing output to a log file

    wsadmin.sh -username username -password password | tee  appfile.txt
    
    $AdminApp installInteractive /path/to/appname.ear
    
  2. Look for message WASX7278I in the output file. You can cut and paste the data in this message into a JACL script. For example...

    WASX7278I: Generated command line: install ../WAS51/appserver/installableapps/jmsample.ear {-BindJndiForEJBNonMessageBinding {{deplmtest.jar MailEJBObject deplmtest.jar,META-INF/ejb-jar.xml ejb/JMSampEJB1 }} -MapResRefToEJB {{deplmtest.jar MailEJBObject deplmtest.jar,META-INF/ejb-jar.xml mail/MailSession9 javax.mail.Session mail/DefaultMailSessionX } {"JavaMail Sample WebApp" mtcomps.war,WEB-INF/web.xml mail/MailSession9 javax.mail.Session mail/DefaultMailSessionY }} -MapWebModToVH {{"JavaMail Sample WebApp" mtcomps.war,WEB-INF/web.xml newhost }} -nopreCompileJSPs -novalidateApp -installed.ear.destination c:/mylocation -distributeApp -nouseMetaDataFromBinary}

  3. Using newly created JACL script, install the app into other clusters...

    wsadmin.sh -username system \ -password password \ -f set_app.jacl clstrname "node1 node2 ..." svrprefix 1 1

 

Using Jython

### Use an EAR file to install the application...

### Using Jython list
AdminApp.install('/path/to/app.ear', ['-server' 'servername'])

### Using Jython string
AdminApp.install('/path/to/appname.ear '[-server servername]')


### Change the application information by prompting 
### you through a series of installation tasks...
AdminApp.installInteractive('/path/to/appname.ear')


### To install the application on a cluster...
$AdminApp install /path/to/appname.ear{-cluster clustername}

### Jython list
AdminApp.install('/path/to/appname.ear', ['-cluster' 'clustername'])


### Jython string
AdminApp.install('/path/to/appname.ear', '[-cluster clustername]')

AdminConfig.save()

 

Install an application non-interactively:

Using Jacl

$AdminApp install /path/to/mymodule1.jar {-server server}

Using Jython list

AdminApp.install('/path/to/mymodule1.jar', '[-server server]')

Using Jython string

AdminApp.install('/path/to/mymodule1.jar', ['-server' 'server'])

 

Install an application interactively

Using Jacl

$AdminApp installInteractive /path/to/mymodule1.jar
$AdminConfig save

Using Jython

AdminApp.installInteractive('/path/to/mymodule1.jar')
AdminConfig.save()

 

Example: Install An Application

The following examples are executed using wsadmin:

Use the AdminApp taskInfo command to obtain information about each task option. Use the AdminApp interactiveInstall command to step through all the installation tasks, one at a time. If you use the installInteractive command to successfully install an application, an option string logs in the wsadmin.traceout file under the message ID WASX7278I. You can copy and paste this option string into wsadmin scripts.