Updating installed applications using the wsadmin scripting 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 also obtain a list of supported options for an Enterprise Archive (EAR) file using the options command, for example:
$AdminApp options
print AdminApp.options()
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.
Perform the following steps to update an application:
Procedure
What to do next
The steps in this task return a success message if the system successfully updates the application. However, the steps might complete successfully before the system extracts each binary file. In a network deployment environment, for example, binary files are extracted after node synchronization is complete. You cannot start the application until the system extracts all binary files. 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. If the system is not ready to start the application, the system might be expanding application binaries. A script that updates an application and then starts it typically would loop around a call to isAppReady until it returns a value of true before attempting to start the application, as shown in the following example:
import time
result = AdminApp.isAppReady('app1')
while (result == "false"):
### Wait 5 seconds before checking again
time.sleep(5)
result = AdminApp.isAppReady('app1')
print("Starting application...")
set result [$AdminApp isAppReady app1]
while {$result == "false"} {
### Wait 5 seconds before checking again
after 5000
set result [$AdminApp isAppReady app1]
}
puts "Starting application..."
AdminApp.getDeployStatus('app1')
Running the getDeployStatus command on app1
results in status
information resembling the following:
ADMA5071I: Distribution status check started for application app1. WebSphere:cell=myCell01,node=myNode01,distribution=unknown,expansion=unknown ADMA5011I: The cleanup of the temp directory for application app1 is complete. ADMA5072I: Distribution status check completed for application app1. WebSphere:cell=myCell01,node=myNode01,distribution=unknown,expansion=unknown