Below article provides some sample usages of the weblogic.Deployer utility.

weblogic.Deployer is a Java-based deployment tool that provides administrators and developers command-line based deployment operations.

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:

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

Best Regards,

Wonders Team. :)

Comments

comments

20 Thoughts on “weblogic.Deployer usage

  1. short and nice info.. thanks!

  2. How cna i deploy libraries using weblogic deployer . I want to deploy it in a remote server .
    Please help me out .
    I tried this option it gives me this error :
    C:\OFM_TEST\user_projects\domains\base_domain>java weblogic.Deployer -adminurl t
    3://10.1.9.88:6501 -username weblogic -password weblogic -deploy -upload C:/D
    ELETE/WLST_Deploy_Test/sew-infrastructure-lib-1-0-1.war -targets BusinessServer
    1 -library -name sew-infrastructure-lib-1-0-1
    weblogic.Deployer invoked with options: -adminurl t3://10.1.9.88:6501 -username
    weblogic -deploy -upload C:/DELETE/WLST_Deploy_Test/sew-infrastructure-lib-1-0-
    1.war -targets BusinessServer1 -library -name sew-infrastructure-lib-1-0-1

    [Deployer:149105]An attempt was made to deploy a library located at ‘/usr/appl/b
    ea92/user_projects/domains/EMC/./servers/Admin/upload/sew-infrastructure-lib-1-0
    -1/app/sew-infrastructure-lib-1-0-1.war’ with name ‘sew-infrastructure-lib-1-0-1
    ‘ that is different from the one specified in the manifest of the library: ‘sew-
    infrastructure-lib’.

    • anandraj on December 28, 2010 at 12:01 am said:

      Hi Kiran,

      The command you are using is correct.
      java weblogic.Deployer -adminurl t3://10.1.9.88:6501 -username weblogic -password weblogic -deploy -upload C:/DELETE/WLST_Deploy_Test/sew-infrastructure-lib-1-0-1.war -targets BusinessServer
      1 -library -name sew-infrastructure-lib-1-0-1

      This error occurs when you attempt to specify a name that is different from the one in the manifest of the library in the source location.
      Solution: Perform deployment again without specifying the name of the library.

      You can look out for the Manifest.mf file and make the changes accordingly.
      Do let us know, how it goes.

      Regards,
      Wonders Team. :)

  3. Hi every one …. i visited this site first time i felt really WONDER.. good discussions..

  4. Hello Anand,

    Can you please let me know if there is an option to deploy my war file to the virtual host and the ejb module to the cluster members?

    Regards,
    Kiran

  5. Alexander on January 24, 2011 at 11:13 am said:

    Good work Weblogic wonders team. Expective more and active discussion in the future. Kudos

  6. Hi,

    I’m trying to update a JSP using the -redeploy. After running the command, i’m getting the message as redeploy completed on Server.

    But, when I check the application, my changes are not reflecting.

    Please help me. Thanks in advance.

    -Yusuf

    • divya on March 11, 2011 at 2:20 am said:

      Hi Yusuf,

      Can you tell me the weblogic server version you are using?

      Also, please let me know the complete command you execute to redeploy the application. Is this the one? –
      java weblogic.Deployer -adminurl url -username username -password password -name myapp -redeploy mywar/index.jsp

      Best Regards,
      Divya

  7. Yusuf on March 11, 2011 at 4:46 am said:

    Hi Divya,

    I’m using 9.2. I’ve deployed the application as exploded directory.

    And, yes, the same i’m using.

    Regards,
    Yusuf

  8. Hi Divya,

    I’m using the version 9.2

    This is the actual command I’m using.

    java weblogic.Deployer -adminurl http://localhost:7001/console -user weblogic -password admin2468 -name myApplication -redeploy myWar/login.jsp

    I tried to do redeploy by touching the REDEPLOY file in autodeploy folder too. Even, that’s not working.

    Could it be possible that, my extended directory itself having some issues? But, java changes are getting reflected automatically. I’m facing issues only with the static files.

    Please help me out.

    Thanks & Regards,
    Yusuf

  9. Hi Divya,

    Still I’m not able to redeploy my JSP.

    I checked the -listapps command. Its returning correct value. Which means the command java weblogic.Deployer -adminurl http://localhost:7001 -username weblogic -password admin2468 is fine in my machine. Only -redeploy is mystery for me :(

    Thanks & Regards,
    Yusuf

  10. divya on March 23, 2011 at 8:11 am said:

    Hi Yusuf,

    You might want to check for the bug 8182370 with oracle support for this issue.

    Best Regards,
    Divya Dureja

  11. yasmin on March 22, 2012 at 1:52 am said:

    i ‘ve installed oer 11g in wls 10.3.3. The installation was successful, but am unable to access the login page of oer server.

    kindly hepl me..

  12. Am getting the following error while undeploying the application

    Exception in thread “main” java.lang.NoClassDefFoundError: weblogic.Deployer
    at gnu.java.lang.MainThread.run(libgcj.so.7rh)
    Caused by: java.lang.ClassNotFoundException: weblogic.Deployer not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
    at java.net.URLClassLoader.findClass(libgcj.so.7rh)
    at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
    at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
    at gnu.java.lang.MainThread.run(libgcj.so.7rh)

    Am using the following command to undeploy it

    java weblogic.Deployer -adminurl http://217.78.215.196:7001/console -username Weblogic -password Awfweb1# -name Artemis -undeploy -targets awf_Preprod

    Thanks in advance
    Regards,
    Dhana

  13. Raghav on May 10, 2013 at 12:45 am said:

    Hi,

    Am still getting following error even after running the setWLSEnv.bat.

    “Exception in thread “main” java.lang.NoClassDefFoundError: weblogic.Deployer”

    Please anybody let me know where should i run this command?

    • Administrator on January 16, 2014 at 1:59 pm said:

      you need to set your environment first.. go to WL_HOME\server\bin and execute setWLSEnv.cmd from the command prompt..

Leave a Reply

Post Navigation