![]() |
![]() |
Moving to Production Mode
Tutorial 20: Redeploying the MedRec Package
This tutorial shows how to use the Administration Console to redeploy the MedRec application to MedRecServer in a production environment. The MedRec applications are contained in the dist directory, packaged in three directories in the recommended exploded format.
Redeploy an application if you have updated its class files or its generated deployment descriptor files.
The tutorial includes the following sections:
|
Prerequisites
Before starting this tutorial:
|
Procedures
This demonstration includes three separate procedures:
Procedure 1: Edit a deployment descriptor without redeploying.
Use the Administration Console to modify certain deployment descriptor elements and their attributes for Applications that are deployed as exploded archive files. You cannot edit these descriptors for applications packaged as EARs.
In this procedure, change the value that determines the number of seconds a Web Application remains idle before timing out.
<session-descriptor>
<session-param>
<param-name>TimeoutSecs</param-name>
<param-value>600</param-value>
</session-param>
Procedure 2: Refresh a static file without redeploying the application.
Use the weblogic.Deployer utility to notify the server when static files have changed.
In this procedure, you change an image, refresh the image file on the server, and view the refreshed file in the Web Application. Clean up the application by restoring the image and refreshing the file again.
Use the file logo.gif in the physicianWebApp component of physicianEar. The Web Application references this file from a virtual directory specified in the weblogic.xml file located in the WEB-INF directory (not from the Web Application images directory).
The relevant stanza from weblogic.xml follows:
<virtual-directory-mapping>
<local-path>C:/bea/weblogic81sp1/weblogic81/samples/server/medrec/src/common/web</local-path>
<url-pattern>images/*</url-pattern>
</virtual-directory-mapping>
WL_HOME\samples\domains\medrec> setMedRecEnv.cmd
Change to the application directory, WL_HOME\samples\server\medrec\dist\physicianEar.
The server reports on the task:
Initiated Task: [11] [Deployer:149026]Redeploy application physicianEar on MedRecServer.
Task 11 completed: [Deployer:149026]Redeploy application physicianEar on MedRecServer.
Deployment completed on Server MedRecServer
java weblogic.Deployer -adminurl http://localhost:7101 -user weblogic -password weblogic -name physicianEar -redeploy ..\..\src\common\web\images\logo.gif
Procedure 3: Redeploy the entire application.
In this procedure it is assumed that MedRec is deployed to a currently running instance of MedRecServer. Follow these steps to update a deployed application whose class files or generated deployment descriptor files have been changed.
|
Best Practices
Redeploying an application in production is a serious undertaking that can affect performance, so plan application updates carefully. Redeploying an application re-sends the entire application over the network to all of the servers targeted by that Web Application. Increased network traffic may affect network performance when an application is re-sent to the Managed Servers. If the application is currently in production and in use, redeploying causes WebLogic Server to lose all active HTTP sessions.
If you have only modified static files, it is probably possible to refresh the files without redeploying the entire application. See Redeploying Static Files in a Web Application in Deploying WebLogic Server Applications.
Some deployment descriptor elements can be modified without redeploying the application. See Viewing and Updating Deployment Descriptors in the Administration Console Online Help.
|
The Big Picture
This tutorial explains how to redeploy an application in production using the Administration Console. You can also use the command-line weblogic.Deploy tool to redeploy applications, and to refresh static files in a deployed application.
If you have added modules in your application, redeploying the application deploys the current modules. If you have deleted modules from your application, explicitly remove them from the application domain to remove them from deployment. See Removing an Application or Module from the Domain in Deploying Applications and Modules.
|
Related Reading
![]() |
![]() |
![]() |