Thursday, June 19, 2014

on
In this post let us see  how to install, start , stop and remove  an application in websphere app server (WAS) using the command line tool wsadmin with JACL script.
Before moving to JACL script, you can visit my earlier tutorial, How to deploy or uninstall ear using Jython script.

Steps to deploy / remove application using JACL script commands:

Start the wsadmin tool that  provides the ability to run scripts written using JACL using the following command.
cd appl_server_profile_root\bin

in Linux : wsadmin.sh -lang jacl

in Windows : wsadmin.bat -lang jacl

Now then enter the commands (below) interactively

-  To list current apps
       $AdminApp list

-Stop application (if it is already started)
         set appManager [$AdminControl queryNames cell=cell_name,node=node_name,type=ApplicationManager,process=server1,*]

     $AdminControl invoke $appManager stopApplication your_appln_name

- Uninstall the application
     $AdminApp uninstall application_name

- Save the above changes
      $AdminConfig save

- Install the application
       $AdminApp install your_ear_file

- Save the above changes
        $AdminConfig save

- Now  verify that the application is installed or not
        $AdminApp list

- Start the application
         $AdminControl invoke $appManager startApplication your_application_name
 
Suppose i need to deploy an application with the following details

          Ear Name - sales.ear
          EAR Path - /root/Desktop/application
          Applicaion Name - salesweb
         Cell Name - uidNode01Cell
          Node Name - uidNode01

To deploy with above details, run the below commands one by one  with wsadmin session

       set appManager [$AdminControl queryNames cell=uidNode01Cell,node=uidNode01,type=ApplicationManager,process=server1,*]
       $AdminControl invoke $appManager stopApplication salesWeb
       $AdminApp list
       $AdminApp uninstall salesWeb
       $AdminConfig save
       $AdminApp install  "/root/Desktop/application/sales.ear"
       $AdminConfig save
       $AdminControl invoke $appManager startApplication salesWeb
Note : In windows environment , to start server ,  use  serverStatus.bat server1 ,  for starting wsadmin ,use  wsadmin.bat -lang jacl   ,

0 comments:

Post a Comment