Administering SAS Web Applications |
In the second maintenance release for SAS 9.2 and later, the Rebuild Web Applications option in the SAS Deployment Manager automatically explodes all EAR files and places them in the SAS-configuration-directory\Lev1\Web\Staging\exploded directory. See When to Rebuild the SAS Web Applications. In most cases, it is the EAR file itself that is deployed to the Web application server. The exploded copies are typically provided for your convenience.
It can be useful to work with exploded EAR files when you want to debug or develop new JavaServer Pages (JSP) in a Web application. If you have deleted the exploded copy, or need to explode an EAR file manually, you can extract the contents for the EAR file into a directory. Second, recursively extract the contents of each WAR file found in the EAR file. Each WAR file needs to be exploded into the same parent directory where it resides.
There are multiple ways to explode EAR files into their constituent parts. EAR files can be exploded manually using command line tools or by using a script. The following task outlines the general steps involved in exploding EAR files.
Change the working directory to the location where the EAR file resides.
Create a subdirectory called exploded.
Change the working directory to the new subdirectory exploded.
Create a subdirectory that matches the name of the EAR file. For example:
filename.ear.
Change the working directory to the filename.ear subdirectory.
Use the jar command to explode the EAR file located in the working directory that is two levels above the current directory.
Create a subdirectory called temp_dir.
For each WAR file that is extracted into the filename.ear subdirectory, complete the following steps:
Move the WAR file to the temp_dir subdirectory.
Create a subdirectory in the filename.ear directory, and make sure that the name of the subdirectory matches the name of the WAR file (for example, filename.war).
Change the working directory to the filename .war directory.
Use the jar command to explode the WAR file from the temp_dir directory.
Change the working directory to the filename.war directory.
Repeat these steps until you have completed extracting all WAR files.
The following example shows how to explode EAR files manually in a UNIX and z/OS environment by using pseudocode that you replace with the applicable syntax:
cd [location of ear] mkdir exploded cd exploded mkdir [earname] cd [earname] jar -xvf ../../[earname] mkdir temp_dir for each [warname]=*.war file move [warname] temp_dir mkdir [warname] cd [warname] jar -xvf ../temp_dir/[warname] cd .. done delete temp_dir cd ../..
Deployment of modified EAR files from an exploded directory varies with the Web application server as follows:
JBoss has direct support for deployment of exploded EAR files. To deploy an exploded EAR file, move the exploded directory to the deployment directory (deploy_sas under the JBoss server). Because the exploded directory must be named the same as the original EAR file, the original EAR file must be removed from the deployment directory.
WebLogic has direct support for deployment of exploded EAR files. To deploy an exploded EAR file using the administrative console, select the full path to the exploded EAR.
WebSphere explodes deployed EAR files on its own. Deployed files must be either EAR files or WAR files.
Starting with version 6.1, WebSphere has the ability to update an existing deployed application with individual files or modules. By selecting the full path to the JSP or WAR directory, individual components of a modified, exploded EAR file can be used in a deployed application. You can use the administrative console to update a deployed application.
When you are ready to deploy your changes, use the SAS Deployment Manager to rebuild the EAR file. See Rebuilding the SAS Web Applications.
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.