The document describes how to use the weblogic.Deployer tool to deploy applications and modules to WebLogic Server. It provides examples for deploying applications to administration servers or managed servers, redeploying individual modules, deploying libraries, using deployment plans, and deploying to administration mode. It also describes best practices like using userconfig and userkey files for secure authentication instead of plain text passwords.
1. weblogic.Deployer usage
Deploy application on admin server:
java weblogic.Deployer -adminurl url -username username -password password -name myapp -deploy c:/myapps/myapp.ear
Deploy individual modules in application to different targets:
java weblogic.Deployer -adminurl url -username username -password password -name myapp -targets
mywar@webserver,myjar@ejbserver -deploy c:/myapps/myapp.ear
Undeploy application from specified targets:
java weblogic.Deployer -adminurl url -username username -password password -name myapp -undeploy -targets
server1,server2..
Redeploy application on current targets:
java weblogic.Deployer -adminurl url -username username -password password -name myapp -redeploy
Redeploy individual module in an application:
java weblogic.Deployer -adminurl url -username username -password password -name myapp -redeploy -targets
moduleA@serverA,moduleA@serverB
Partially redeploy, for example, to update a JSP in a exploded webapp:
java weblogic.Deployer -adminurl url -username username -password password -name myapp -redeploy mywar/index.jsp
The path of JSP to be updated is relative to the root of the application. If a directory is specified the entire subtree is updated.
Multiple servers sharing the same physical deployment:
java weblogic.Deployer -adminurl url -username username -password password -name myapp -targets server1,server2 -nostage
-deploy c:/myapps/myapp.ear
The -nostage option indicates that the application is available on all target servers at the same path and hence server should not
copy files to the managed servers.
Deploy the first application version on admin server:
java weblogic.Deployer -adminurl url -username username -password password -name myapp -deploy c:/myapps/myapp_v1.ear
Perform Production Redeployment of a new application version on admin server:
java weblogic.Deployer -adminurl url -username username -password password -name myapp -redeploy -source
c:/myapps/myapp_v2.ear
Note: The above feature is used for Side By Side deployment strategies ideally preferred for production environments.
Refer the below article know more about Side By Side deployment.
http://weblogic-wonders.com/weblogic/2009/12/02/side-by-side-deploymentversioning/
Deploy application to administration mode on admin server:
java weblogic.Deployer -adminurl url -username username -password password -name myapp -deploy c:/myapps/myapp.ear
-adminmode
Note: The above feature is ideally used for sanity testing so that the application can process only admin requests.
Transition application from administration mode to running on admin server:
java weblogic.Deployer -adminurl url -username username -password password -name myapp -start
Transition application from running to administration mode on admin server:
2. java weblogic.Deployer -adminurl url -username username -password password -name myapp -stop -adminmode
Deploy a library on admin server:
java weblogic.Deployer -adminurl url -username username -password password -name mylib -library -libspecver 1.0 -libimplver
2.0 -deploy c:/myapps/mylib.jar
Note: This feature would deploy the file as library rather than as an application.
Deploy an application on admin server with a deployment plan:
java weblogic.Deployer -adminurl url -username username -password password -plan c:/myapps/myapp/plan/plan.xml -deploy
c:/myapps/myapp/app/myapp.jar
Note: The above feature uses plan.xml to help administrators easily change an application’s WebLogic Server configuration for a
specific environment without modifying existing Java EE or WebLogic-specific deployment descriptors.
Refer the below article for a sample usage of plan.xml
http://weblogic-wonders.com/weblogic/2009/11/29/plan-xml-usage-for-message-driven-bean/
Update an application configuration:
java weblogic.Deployer -adminurl url -username username -password password -plan c:/myapps/myapp/plan/newplan.xml
-name myapp -update
Deploy a queue to a specific JMS server:
java weblogic.Deployer -adminurl url -username username -password password -submoduletargets
myqueue@myjmsmodule@JMSServer -deploy c:/myapps/myapp/app/myapp.ear
For documentation on weblogic.Deployer refer the below link:-
http://download.oracle.com/docs/cd/E14571_01/web.1111/e13702/wldeployer.htm
For trouble shooting deployment issues refer the below article.
http://weblogic-wonders.com/weblogic/2010/11/30/deployment-issues-on-weblogic-server/
Note: In the above examples we are specifying the username and password in plain text format and that could cause a security
issue.
You can use the STOREUSERCONFIG feature of the weblogic.Admin utility which generates userconfig file and userkey file
containing an encrypted username and password.
Refer the below article for more information on userconfig and userkey files.
http://weblogic-wonders.com/weblogic/2009/11/30/steps-to-use-userconfig-file-and-userkey-file/
For example, deploying an ear file using the userConfigFile feature is below.
java weblogic.Deployer -userconfigfile C:/bea103/storeconfig/config-file -userkeyfile C:/bea103/storeconfig/keyfile -name
myapp -targets MS1,MS2 -deploy C:/myapps/myapp.ear