Contents
<< Previous
Describe what a deployment plan does
J2EE Deployment Plan
* An XML file associated with an application
* Resides outside an an application archive
* Finds and replaces values in the J2EE deployment descriptors
* Sets additional configurable properties such as tuning parameters
* Allow deploying same archive to different environments
Tools to Create a Deployment Plan
* Development tools
– JDev
– Eclipse
* weblogic.PlanGenerator
* Admin console
Recommended Directory Structure for Production Deployment
* Recommended directory structure:
appReleases
|-appA
|-|-app
|-|-plan
|-|-AppFileOverrides
* Need to specify config-root within the plan
Create a deployment plan with weblogic.PlanGenerator
* Syntax:
java weblogic.PlanGenerator [options] [application]
* Options
-debug
-plan plan_file
-useplan plan_file
-root root_directory
-all
-configurables
-dependencies
-declarations
-dynamics
-none
* Example
java weblogic.PlanGenerator -all ./appA.war
* See this post for more examples
Create a deployment plan via the admin console
* If following recommended directory structure for deployment, plan.xml is generated in the plan directory once application is deployed.
* Otherwise, make a configuration change to the deployed application and save it when prompted:
Use a deployment plan with an application
For Example: update context-param
* See this post. Briefly:
– Define a variable (e.g. wsdlUrl) with the new value
<application-name>helloworld.ear</application-name> <variable-definition> <!-- add the wsdl var --> <variable> <name>wsdlUrl</name> <value>http://prod_svr:7101/ws_helloworld/HelloWorldServicePort?WSDL</value> </variable> </variable-definition>
– Replace web.xml with the new value
<module-descriptor external="false"> <root-element>web-app</root-element> <uri>WEB-INF/web.xml</uri> <!-- replace the wsdl url with the deployment url --> <variable-assignment> <name>wsdlUrl</name> <xpath>/web-app/context-param/[param-name="wsdlUrl"]/param-value</xpath> <operation>replace</operation> </variable-assignment> </module-descriptor> </module-override>
* Deploy with the new plan:
Deploy with production redeployment (versioned applications)
Overview
* Supports only HTTP clients and RMI clients
* Existing clients continue to use older version of app
* New clients are directed to new version of app
* Older version is retired when all existing clients complete their work
Configure
* Specify a unique version in
– META-INF/MANIFEST.MF (preferred)
Manifest-Version: 1.0 Created-By: 1.5.0_04-b01 (Sun Microsystems Inc.) Weblogic-Application-Version: v1
– or Admin Console
Distributing vs Redeploying
* Distributing: makes a new version of app available for testing before being released for general consumption
* Redeploying: places the new version immediately into use
Distribute an App
* Use weblogic.Deployer -distribute command to distribute an app
java weblogic.Deployer -adminurl http://localhost:7011 -user system -password weblogic -distribute -name retirement -source /myDeployments/myApplication/retirement -appversion 2.0
* Start app in Administration mode
* Test the app using admin channel
* When ready, start the app
java weblogic.Deployer -adminurl http://localhost:7011 -user system -password weblogic -start -adminmode -name retirement -source /myDeployments/myApplication/retirement -appversion 2.0
* Set the retirement timeout for the older version
java weblogic.Deployer -adminurl http://localhost:7011 -user system -password weblogic -start -name retirement -appversion 2.0 -retiretimeout 300
Define the staging modes (stage, nostage, external stage)
* stage: files are copies to the pre-configured stating staging directory for preparation and activation
* nostage: files are deployed from a static location
* external stage: files are copied by a user or a third party tool (e.g. JDev) before deployment
Next >>
[mv_include id=’3268′]
* WebLogic 11g Deployment: Configuring Applications for Production Deployment