Update installed applications with wsadmin
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.
- With clusters, the application restarts after the save and node synchronization.
To control when synchronization occurs on multiple-server products, in the console, deselect...
Synchronize changes with nodes
Update a single file in a deployed application
- Jacl...
$AdminApp update appname file {-operation update -contents /path/to/appname/my.xml -contenturi appname.jar/my.xml}- Jython string:
AdminApp.update('appname', 'file', '[-operation update -contents /path/to/appname/my.xml -contenturi appname.jar/my.xml]')- Jython list:
AdminApp.update('appname', 'file', ['-operation', 'update', '-contents', '/path/to/appname/my.xml', '-contenturi', 'appname.jar/my.xml'])
Add a module to the deployed application
If the module does not exist. Otherwise, the existing module is updated.
- Jacl...
$AdminApp update appname modulefile {-operation addupdate -contents /path/to/appname/Increment.jar -contenturi Increment.jar -nodeployejb -BindJndiForEJBNonMessageBinding {{"Increment EJB module" Increment Increment.jar,META-INF/ejb-jar.xml Inc}}}- Jython string:
AdminApp.update('appname', 'modulefile', '[-operation addupdate -contents /path/to/appname/Increment.jar -contenturi Increment.jar -nodeployejb -BindJndiForEJBNonMessageBinding [["Increment EJB module" Increment Increment.jar,META-INF/ejb-jar.xml Inc]]]')- Jython list:
bindJndiForEJBValue = [["Increment EJB module", "Increment", " Increment.jar,META-INF/ejb-jar.xml", "Inc"]] AdminApp.update('appname', 'modulefile', ['-operation', 'addupdate', '-contents', '/path/to/appname/Increment.jar', '-contenturi','Increment.jar' '-nodeployejb', `-BindJndiForEJBNonMessageBinding', bindJndiForEJBValue])To determine the value of BindJndiForEJBNonMessageBinding
#Jacl
AdminApp.view('myAppName')
#Jython
$AdminApp view myAppName
Use a partial application to update a deployed application
- Jacl...
$AdminApp update appname partialapp {-contents /path/to/appname/appnamePartial.zip}- Jython string:
AdminApp.update('appname', 'partialapp', '[-contents /path/to/appname/appnamePartial.zip]')- Jython list:
AdminApp.update('appname', 'partialapp', ['-contents', '/path/to/appname/appnamePartial.zip'])
Update 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 spec when specify the --usedefaultbindings option to deploy an application. If an activation spec 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.
- Jacl...
$AdminApp update appname app {-operation update -contents /path/to/appname/newApp1.ear -usedefaultbindings -nodeployejb -BindJndiForEJBNonMessageBinding {{"Increment EJB module" Increment Increment.jar,META-INF/ejb-jar.xml Inc}}}- Jython string:
AdminApp.update('appname', 'app', '[-operation update -contents /path/to/appname/newApp1.ear -usedefaultbindings -nodeployejb -BindJndiForEJBNonMessageBinding [["Increment EJB module" Increment Increment.jar,META-INF/ejb-jar.xml Inc]]]')- Jython list:
bindJndiForEJBValue = [["Increment EJB module", "Increment", "Increment.jar,META-INF/ejb-jar.xml", "Inc"]] AdminApp.update('appname', 'app', ['-operation', 'update', '-contents', '/path/to/appname/NewApp1.ear', '-usedefaultbindings', '-nodeployejb', `-BindJndiForEJBNonMessageBinding', bindJndiForEJBValue])To determine the value of options...
AdminApp.view('myAppName')
$AdminApp view myAppNameSave the configuration changes... AdminConfig.save()In a network deployment environment only, synchronize the node. Use the syncActiveNode or syncNode scripts in the AdminNodeManagement script library to propagate the configuration changes to node or nodes.
- the syncActiveNodes script to propagate the changes to each node in the cell...
AdminNodeManagement.syncActiveNodes()- the syncNode script to propagate the changes to a specific node, as the following example demonstrates:
AdminNodeManagement.syncNode("myNode")
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. We cannot start the application until the system extracts all binary files. If we installed a large application, use the isAppReady and getDeployStatus commands for AdminApp 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.
AdminApp.isAppReady('myappname')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 example displays:
AdminApp.getDeployStatus('appname')
Related tasks
Use AdminApp for scripted administration
Related
Commands for AdminApp
Options for AdminApp install, installInteractive, edit, editInteractive, update, and updateInteractive commands
Example: Obtaining option information for AdminApp object commands