14.5.5 Performing multiple updates to an application or module
Multiple updates to an application and its modules can be packaged in a compressed file, .zip, or .gzip format, and uploaded to WAS. The uploaded file is analyzed and the necessary actions to update the application are taken.
Depending on the contents of the compressed file, this method to update an application can replace files in, add new files to, and delete files from the installed application all in one single administrative action. Each entry in the compressed file is treated as a single file, and the path of the file from the root of the compressed file is treated as the relative path of the file in the installed application.
-
| To replace a file, a file in the compressed file must have the same relative path as the file to be updated in the installed application.
|
-
| To add a new file to the installed application, a file in the compressed file must have a different relative path than the files in the installed application.
|
-
| To remove a file from the installed application, specify metadata in the compressed file using a file named META-INF/ibm-partialapp-delete.props at any archive scope. The ibm-partialapp-delete.props file must be an ASCII file that lists files to be deleted in that archive with one entry for each line. The entry can contain a string pattern, such as a regular expression that identifies multiple files. The file paths for the files to be deleted must be relative to the archive path that has the META-INF/ibm-partialapp-delete.props file.
|
-
| To delete a file from the EAR file (not a module), include a META-INF/ibm-partialapp-delete.props file in the root of the compressed file. In the .props file, list the files to be deleted. File paths are relative to the root of the EAR file.
|
For example, to delete a file named docs/readme.txt from the root of the HelloApp.ear file, include the line docs/readme.txt in the META-INF/ibm-partialapp-delete.props file in the compressed file.
-
| To delete a file from a module in the EAR, include a module_uri/META-INF/ibm-partialapp-delete.props file in the compressed file. The module_uri part is the name of the module, such as HelloWeb.war.
|
For example, to delete images/logo.gif from the HelloWeb.war module, include the line images/logo.gif in the HelloWeb.war/META-INF/ibm-partialapp-delete.props file in the compressed file.
-
| Multiple files can be deleted by specifying each file on its own line in the metadata .props file.
|
Regular expressions can also be used to target multiple files. For example, to delete all JavaServer Pages (.jsp files) from the HelloWeb.war file, include the line .*jsp in the HelloWeb.war/META-INF/ibm-partialapp-delete.props file. The line uses a regular expression, .*jsp, to identify all .jsp files in the HelloWeb.war module.
As an example, assume we have prepared the compressed HelloApp_update.zip file shown in Figure 14-10.
Figure 14-10 HelloApp_update.zip compressed file
The META-INF/ibm-partialapp-delete.props file contains the following line:
docs/readme.txt
The HelloWeb.war/META-INF/ibm-partialapp-delete.props contains the following lines:
images/logo.gif
When performing the partial application update using the compressed file, WebSphere does the following:
-
| Adds the log4j.jar file to the root of the EAR.
|
-
| Updates the entire HelloEJB.jar module.
|
-
| Deletes the docs/readme.txt file (if it exists) from the EAR file, but not from any modules.
|
-
| Adds the images/newlogo.jpg file to the HelloWeb.war module.
|
-
| Updates the HelloServlet.class file in the WEB-INF/classes/com/itso/wrd/servlets directory of the HelloWeb.war module.
|
-
| Deletes the images/logo.gif file from the HelloWeb.war module.
|
To perform the actions specified in the HelloWeb_updated.zip file...
1.
| Select Applications | Enterprise Applications. Select the application to update and click the Update button.
|
2.
| On the Preparing for the application installation window, select the Partial Application option.
|
3.
| Select either the Local file system or Remote file system option and click the Browse button to select the compressed ZIP file with the modifications you have created. Click Next.
|
4.
| On the Updating Application window, click OK.
|
5.
| When the application has been updated in the Master repository, select the Save To Master Configuration link.
|
6.
| If in a distributed server environment, make sure the Synchronize changes with Nodes option is selected so that the application is distributed to all nodes. Click the Save button. The application is distributed to the nodes, updated, and restarted as necessary
|
7.
| If the application update changes the set of URLs handled by the application (servlet mappings added, removed or modified), make sure the Web server plug-in is regenerated and propagated to the Web server.
|
|