IT技术及科技前沿

中文IT博客,为IT专业技术人员提供最全面的信息传播和服务

首页 新随笔 订阅 管理

Illustrates how to use a deployment plan to change the value of a deployment descriptor that is embedded in an EAR file at deploy / runtime with WebLogic Server 9.x and above. This does not modify the EAR file in any way, it simply provides a mechanism to provide adjustments to deployment descriptors without changing an archive that may have been tested and QA'ed.

 

A simple application shows the value of a web.xml context parameter that is originally set to "development". There are two other deployment plans provided that can be deployed with the application to change the "environment" context parameter to either "qualityassurance" or "production". This leverages WebLogic Server's deployment API and support for JSR-88, also known as deployment plans.

 

Call your WLS domain setDomainEnv script. Then in the same shell execute these commands substituting for your hostname, port, user, password, and server targest as required.

java weblogic.Deployer -adminurl t3://localhost:7001 -user weblogic -password welcome1 -redeploy -name PlanExampleApp -source PlanExampleApp.ear

Look at the application. The default URL of:
http://localhost:7001/PlanExampleWeb/
Should show the text:
The Context Parameter for environment is: development

Now execute this command substituting the appropriate path for the qaPlan.xml and other parameters:
java weblogic.Deployer -adminurl t3://localhost:7001 -user weblogic -password welcome1 -redeploy -name PlanExampleApp -plan c:\temp\plan\qaPlan.xml

Look at the application again. The default URL of:
http://localhost:7001/PlanExampleWeb/
Should now show the adjusted text:
The Context Parameter for environment is: qualityassurance

Now execute this command substituting the appropriate path for the prodPlan.xml and other parameters:
java weblogic.Deployer -adminurl t3://localhost:7001 -user weblogic -password welcome1 -redeploy -name PlanExampleApp -plan c:\temp\plan\prodPlan.xml

Look at the application again. The default URL of:
http://localhost:7001/PlanExampleWeb/
Should now show the adjusted text:
The Context Parameter for environment is: production

 

DeploymentPlanSample.zip 

posted on 2010-12-27 10:55  孟和2012  阅读(461)  评论(0编辑  收藏  举报