Updating installed applications with the wsadmin tool

Use the wsadmin tool and scripting to update installed applications on an application server.

About this task

Both the update command and the updateinteractive command support a set of options. You can obtain a list of supported options for an Enterprise Archive (EAR) file using the options command, for example:
Using Jacl:
$AdminApp options
Using Jython:
print AdminApp.options()
Attention: If an application is running, changing an application setting causes the application to restart. On stand-alone servers, the application restarts after you save the change. On multiple-server products, the application restarts after you save the change and files synchronize on the node where the application is installed.

Procedure

  1. Launch the wsadmin scripting tool.
  2. Update the installed application using one of the following options:
    • The following command updates a single file in a deployed application:
      • Using Jacl:

        [AIX HP-UX Linux Solaris Windows]
        $AdminApp update app1 file {-operation update -contents c:/apps/app1/my.xml -contenturi app1.jar/my.xml}
        [z/OS]
        $AdminApp update app1 file {-operation update -contents /apps/app1/my.xml -contenturi app1.jar/my.xml}
        [iSeries]
        $AdminApp update app1 file {-operation update -contents /home/myProfile/apps/app1/my.xml 
        -contenturi app1.jar/my.xml}
      • Using Jython string:

        [AIX HP-UX Linux Solaris Windows]
        AdminApp.update('app1', 'file', '[-operation update -contents c:/apps/app1/my.xml 
        -contenturi app1.jar/my.xml]')
        [z/OS]
        AdminApp.update('app1', 'file', '[-operation update -contents /apps/app1/my.xml 
        -contenturi app1.jar/my.xml]')
        [iSeries]
        AdminApp.update('app1', 'file', '[-operation update -contents /home/myProfile/
        apps/app1/my.xml -contenturi app1.jar/my.xml]')
      • Using Jython list:

        [AIX HP-UX Linux Solaris Windows]
        AdminApp.update('app1', 'file', ['-operation', 'update', '-contents', 'c:/apps/app1/my.xml', 
        '-contenturi', 'app1.jar/my.xml'])
        [z/OS]
        AdminApp.update('app1', 'file', ['-operation', 'update', '-contents', '/apps/app1/my.xml', 
        '-contenturi', 'app1.jar/my.xml'])
        [iSeries]
        AdminApp.update('app1', 'file', ['-operation', 'update', '-contents', '/home/myProfile/apps/
        app1/my.xml', '-contenturi', 'app1.jar/my.xml'])
      where:
      $ is a Jacl operator for substituting a variable name with its value
      AdminApp is an object that supports application objects management
      update is an AdminApp command
      app1 is the name of the application to update
      file is the content type value
      operation is an option of the update command
      update is the value of the operation option
      contents is an option of the update command
      /apps/app1/my.xml is the value of the contents option
      contenturi is an option of the update command
      app1.jar/my.xml is the value of the contenturi option
    • The following command adds a module to the deployed application, if the module does not exist. Otherwise, the existing module is updated.
      • Using Jacl:

        [AIX HP-UX Linux Solaris Windows]
        $AdminApp update app1 modulefile {-operation addupdate -contents 
        c:/apps/app1/Increment.jar -contenturi Increment.jar -nodeployejb 
        -BindJndiForEJBNonMessageBinding {{"Increment EJB module"
         Increment Increment.jar,META-INF/ejb-jar.xml Inc}}}
        [z/OS]
        $AdminApp update app1 modulefile {-operation addupdate -contents 
        /apps/app1/Increment.jar -contenturi Increment.jar -nodeployejb 
        -BindJndiForEJBNonMessageBinding {{"Increment EJB module"
         Increment Increment.jar,META-INF/ejb-jar.xml Inc}}}
        [iSeries]
        $AdminApp update app1 modulefile {-operation addupdate -contents 
        /home/myProfile/apps/app1/Increment.jar -contenturi Increment.jar -nodeployejb 
        -BindJndiForEJBNonMessageBinding {{"Increment EJB module"
         Increment Increment.jar,META-INF/ejb-jar.xml Inc}}}
      • Using Jython string:

        [AIX HP-UX Linux Solaris Windows]
        AdminApp.update('app1', 'modulefile', '[-operation addupdate -contents 
        c:/apps/app1/Increment.jar -contenturi Increment.jar -nodeployejb 
        -BindJndiForEJBNonMessageBinding [["Increment EJB module
        " Increment Increment.jar,META-INF/ejb-jar.xml Inc]]]')
        [z/OS]
        AdminApp.update('app1', 'modulefile', '[-operation addupdate -contents 
        /apps/app1/Increment.jar -contenturi Increment.jar -nodeployejb 
        -BindJndiForEJBNonMessageBinding [["Increment EJB module
        " Increment Increment.jar,META-INF/ejb-jar.xml Inc]]]')
        [iSeries]
        AdminApp.update('app1', 'modulefile', '[-operation addupdate -contents 
        /home/myProfile/apps/app1/Increment.jar -contenturi Increment.jar -nodeployejb 
        -BindJndiForEJBNonMessageBinding [["Increment EJB module
        " Increment Increment.jar,META-INF/ejb-jar.xml Inc]]]')
      • Using Jython list:

        [AIX HP-UX Linux Solaris Windows]
        bindJndiForEJBValue = [["Increment EJB module", 
        "Increment", " Increment.jar,META-INF/ejb-jar.xml", "Inc"]]
        
        AdminApp.update('app1', 'modulefile', ['-operation', 'addupdate', '-contents', 
        'c:/apps/app1/Increment.jar', '-contenturi','Increment.jar' '-nodeployejb', 
        `-BindJndiForEJBNonMessageBinding', bindJndiForEJBValue])
        [z/OS]
        bindJndiForEJBValue = [["Increment EJB module", 
        "Increment", " Increment.jar,META-INF/ejb-jar.xml", "Inc"]]
        
        AdminApp.update('app1', 'modulefile', ['-operation', 'addupdate', '-contents', 
        '/apps/app1/Increment.jar', '-contenturi','Increment.jar' '-nodeployejb', 
        `-BindJndiForEJBNonMessageBinding', bindJndiForEJBValue])
        [iSeries]
        bindJndiForEJBValue = [["Increment EJB module", 
        "Increment", " Increment.jar,META-INF/ejb-jar.xml", "Inc"]]
        
        AdminApp.update('app1', 'modulefile', ['-operation', 'addupdate', '-contents', 
        '/home/myProfile/apps/app1/Increment.jar', '-contenturi','Increment.jar' '-nodeployejb', 
        `-BindJndiForEJBNonMessageBinding', bindJndiForEJBValue])
      where:
      $ is a Jacl operator for substituting a variable name with its value
      AdminApp is an object that supports application objects management
      update is an AdminApp command
      app1 is the name of the application to update
      modulefile is the content type value
      operation is an option of the update command
      addupdate is the value of the operation option
      contents is an option of the update command
      /apps/app1/Increment.jar is the value of the contents option
      contenturi is an option of the update command
      Increment.jar is the value of the contenturi option
      nodeployejb is an option of the update command
      BindJndiForEJBNonMessageBinding is an option of the update command
      "Increment EJB module" Increment Increment.jar,META-INF/ejb-jar.xml Inc is the value of the BindJndiForEJBNonMessageBinding option. The value of this option is defined in your application configuration. To determine the value of this option, use the following Jython or Jacl command:
      Using Jython:
      AdminApp.view('myAppName')
      Using Jacl:
      $AdminApp view myAppName
      bindJndiForEJBValue is a Jython variable that contains the value of the BindJndiForEJBNonMessageBinding option
    • The following command uses a partial application to update a deployed application:
      • Using Jacl:

        [AIX HP-UX Linux Solaris Windows]
        $AdminApp update app1 partialapp {-contents c:/apps/app1/app1Partial.zip}
        [z/OS]
        $AdminApp update app1 partialapp {-contents /apps/app1/app1Partial.zip}
        [iSeries]
        $AdminApp update app1 partialapp {-contents /home/myProfile/apps/app1/app1Partial.zip}
      • Using Jython string:

        [AIX HP-UX Linux Solaris Windows]
        AdminApp.update('app1', 'partialapp', '[-contents c:/apps/app1/app1Partial.zip]')
        [z/OS]
        AdminApp.update('app1', 'partialapp', '[-contents /apps/app1/app1Partial.zip]')
        [iSeries]
        AdminApp.update('app1', 'partialapp', '[-contents /home/myProfile/apps/app1/app1Partial.zip]')
      • Using Jython list:

        [AIX HP-UX Linux Solaris Windows]
        AdminApp.update('app1', 'partialapp', ['-contents', 'c:/apps/app1/app1Partial.zip'])
        [z/OS]
        AdminApp.update('app1', 'partialapp', ['-contents', '/apps/app1/app1Partial.zip'])
        [iSeries]
        AdminApp.update('app1', 'partialapp', ['-contents', '/home/myProfile/apps/app1/app1Partial.zip'])
      where:
      $ is a Jacl operator for substituting a variable name with its value
      AdminApp is an object that supports application objects management
      update is an AdminApp command
      app1 is the name of the application to update
      partialapp is the content type value
      contents is an option of the update command
      /apps/app1/app1Partial.zip is the value of the contents option
    • The following command updates the entire deployed application.

      To use the existing listener port instead of using or creating a new activation specification, determine whether the EJB JAR version is lower than 2.1. The system automatically creates and uses an activation specification when you specify the -usedefaultbindings option to deploy an application. If an activation specification exists, the system ignores the listener port, and instead uses the activation specification. To deploy an application with an EJB JAR version greater than or equal to 2.1 using the defined listener ports instead of a new activation specification, set the com.ibm.websphere.management.application.dfltbndng.mdb.preferexisting system property to true in the wsadmin.properties file in the properties directory of the profile of interest.

      • Using Jacl:

        [AIX HP-UX Linux Solaris Windows]
        $AdminApp update app1 app {-operation update -contents c:/apps/app1/newApp1.jar 
        -usedefaultbindings -nodeployejb -BindJndiForEJBNonMessageBinding 
        {{"Increment EJB module" Increment Increment.jar,META-INF/ejb-jar.xml Inc}}}
        [z/OS]
        $AdminApp update app1 app {-operation update -contents /apps/app1/newApp1.jar 
        -usedefaultbindings -nodeployejb -BindJndiForEJBNonMessageBinding 
        {{"Increment EJB module" Increment Increment.jar,META-INF/ejb-jar.xml Inc}}}
        [iSeries]
        $AdminApp update app1 app {-operation update -contents /home/myProfile/apps/app1/newApp1.jar 
        -usedefaultbindings -nodeployejb -BindJndiForEJBNonMessageBinding 
        {{"Increment EJB module" Increment Increment.jar,META-INF/ejb-jar.xml Inc}}}
      • Using Jython string:

        [AIX HP-UX Linux Solaris Windows]
        AdminApp.update('app1', 'app', '[-operation update -contents c:/apps/app1/newApp1.ear 
        -usedefaultbindings -nodeployejb -BindJndiForEJBNonMessageBinding 
        [["Increment EJB module" Increment Increment.jar,META-INF/ejb-jar.xml Inc]]]')
        [z/OS]
        AdminApp.update('app1', 'app', '[-operation update -contents /apps/app1/newApp1.ear 
        -usedefaultbindings -nodeployejb -BindJndiForEJBNonMessageBinding 
        [["Increment EJB module" Increment Increment.jar,META-INF/ejb-jar.xml Inc]]]')
        [iSeries]
        AdminApp.update('app1', 'app', '[-operation update -contents /home/myProfile/apps/app1/
        newApp1.ear -usedefaultbindings -nodeployejb -BindJndiForEJBNonMessageBinding 
        [["Increment EJB module" Increment Increment.jar,META-INF/ejb-jar.xml Inc]]]')
      • Using Jython list:

        [AIX HP-UX Linux Solaris Windows] [iSeries]
        bindJndiForEJBValue = [["Increment EJB module", "Increment", " Increment.jar,META-INF/
        ejb-jar.xml", "Inc"]]
        
        AdminApp.update('app1', 'app', ['-operation', 'update', '-contents', 
        'c:/apps/app1/NewApp1.ear', '-usedefaultbindings', '-nodeployejb', 
        `-BindJndiForEJBNonMessageBinding', bindJndiForEJBValue])
        
        [z/OS]
        bindJndiForEJBValue = [["Increment EJB module", "Increment", " Increment.jar,META-INF/
        ejb-jar.xml", "Inc"]]
        
        AdminApp.update('app1', 'app', ['-operation', 'update', '-contents', 
        '/apps/app1/NewApp1.ear', '-usedefaultbindings', '-nodeployejb', 
        `-BindJndiForEJBNonMessageBinding', bindJndiForEJBValue])
        
      where:
      $ is a Jacl operator for substituting a variable name with its value
      AdminApp is an object that supports application objects management
      update is an AdminApp command
      app1 is the name of the application to update
      app is the content type value
      operation is an option of the update command
      update is the value of the operation option
      contents is an option of the update command
      /apps/app1/newApp1.ear is the value of the contents option
      usedefaultbindings is an option of the update command.
      nodeployejb is an option of the update command
      BindJndiForEJBNonMessageBinding is an option of the update command
      "Increment EJB module" Increment Increment.jar,META-INF/ejb-jar.xml Inc is the value of the BindJndiForEJBNonMessageBinding option. The value of this option is defined in your application configuration. To determine the value of this option, use the following Jython or Jacl command:
      Using Jython:
      AdminApp.view('myAppName')
      Using Jacl:
      $AdminApp view myAppName
      bindJndiForEJBValue is a Jython variable containing the value of the BindJndiForEJBNonMessageBinding option
  3. Save the configuration changes.
    Use the following Jython command to save your configuration changes:
    AdminConfig.save()
  4. In a network deployment environment only, synchronize the node. See the Synchronizing nodes with the wsadmin tool article for more information.

What to do next

The steps in this task return a success message if the system successfully updates the application. When updating 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, as the following examples display:

Using Jython:
AdminApp.isAppReady('app1')
Using Jacl:
$AdminApp isAppReady app1

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:
AdminApp.getDeployStatus('app1')
Using Jacl:
$AdminApp getDeployStatus app1



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: Feb 19, 2011 5:25:36 AM CST
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=v610web&product=was-nd-mp&topic=txml_updatingapp
File name: txml_updatingapp.html