Redeploying Applications in a Production Environment 8-15
8.6 Using Partial Redeployment for J2EE Module Updates
The weblogic.Deployer utility uses a different command form if you want to redeploy individual modules of a deployed Enterprise application. To redeploy a
subset of the modules of an Enterprise application, specify modulename
servername in the target server list to identify the modules you want to redeploy. For example:
java weblogic.Deployer -adminurl http:localhost:7001 -user weblogic -password weblogic -redeploy -name myApp
-targets mymodule1myserver1,mymodule2myserver2
If the application was previously deployed to a cluster, you must redeploy the module to the entire cluster, rather than a subset of servers. If you specify a subset of servers in
the cluster, weblogic.Deployer responds with the error:
An attempt to add server target target_name to module module_name has been rejected. This is because its parent cluster, cluster_name, is aso targeted by the
module.
8.6.1 Restrictions for Updating J2EE Modules in an EAR
The following restrictions apply to using partial redeployment for modules in an Enterprise application:
■
If redeploying a single J2EE module in an Enterprise application would affect other J2EE modules loaded in the same classloader, weblogic.Deployer
requires that you explicitly redeploy all of the affected modules. If you attempt to use partial redeployment with only a subset of the affected J2EE modules,
weblogic.Deployer displays the error:
Exception:weblogic.management.ApplicationException: [J2EE:160076] You must include all of [module_list] in your files list to modify [module]
■
Remember that if you change an applications deployment descriptor files, the container redeploys the entire application even if you attempt a partial
redeployment.
■
JAR files in WEB-INFlib cannot be redeployed independently of the rest of the Web application. The container automatically redeploys the entire application, but
maintains the state, when redeploying JAR files in WEB-INFlib.
8.6.2 Best Practices for Updating J2EE Modules in an EAR
Keep in mind these best practices when using partial redeployment for Enterprise application modules:
■
When you use partial redeployment to redeploy a J2EE module in an Enterprise application, all classes loaded in the classloader for the updated module are
reloaded. You can define custom class loading hierarchies in the WebLogic Server deployment descriptor to minimize the impact of partial redeployment to other
modules in the application. See WebLogic Server Application Classloading in
Note: The use of -redeploy module-uri is deprecated. Instead, use
production redeployment or redeploy the module using the -targets moduletarget
syntax.
8-16 Deploying Applications to Oracle WebLogic Server
Developing Applications for Oracle WebLogic Server for more information on class loading behavior.
■
Classes in the WEB-INFclasses directory can no longer be redeployed independently of the rest of the Web application. You can deploy only the updated
classes rather than the entire WEB-INFclasses directory by setting the Reload Period for the Web application. See weblogic.xml Schema in Developing Web
Applications, Servlets, and JSPs for Oracle WebLogic Server for more information. See also, Changing Classes in a Running Program in Developing Applications for Oracle
WebLogic Server and
Section 3.6, Using FastSwap Deployment to Minimize Redeployment.
■
By default, WebLogic Server destroys current user sessions when you redeploy a Web application module. If you want to preserve Web application user sessions
during redeployment, set save-sessions-enabled to true in the container-descriptor stanza of the weblogic.xml deployment descriptor
file. Note, however, that the application still remains unavailable while in-place redeployment takes place.
8.7 Updating Static Files in a Deployed Application