+

Search Tips   |   Advanced Search

Starting applications using wsadmin.sh

Use scripting and the wsadmin tool to start an application that is not running.

There are two ways to complete this task. This topic uses the AdminControl object to start an application. Alternatively, you can use the scripts in the AdminApplication script library to start, stop, and manage applications.


Tasks

  1. Start the wsadmin scripting tool.
  2. Identify the application manager MBean for the server where the application resides and assign it the appManager variable. The following example returns the name of the application manager MBean.

    • Jacl:
       set appManager [$AdminControl queryNames cell=mycell,node=mynode,type
      =ApplicationManager,
      process=server1,*]
      
    • Jython:
      appManager = AdminControl.queryNames('cell=mycell,node=mynode,type
      =ApplicationManager,
      process=server1,*')
      print appManager
      

    Command element Description
    set Jacl command
    appManager Variable name
    $ Jacl operator for substituting a variable name with its value
    AdminControl Enable the manipulation of MBeans running in a WebSphere Application Server process
    queryNames AdminControl command
    cell=mycell,node=mynode,type=ApplicationManager,process=server1 is the hierarchical containment path of the configuration object
    print Jython command

    Example output:

    WebSphere:cell=mycell,name=ApplicationManager,mbeanIdentifier=ApplicationManager,
    type=ApplicationManager,node=mynode,process=server1
    

  3. Start the application. The following example invokes the startApplication operation on the MBean, providing the application name that you want to start.

    • Jacl:
      $AdminControl invoke $appManager startApplication myApplication
      
    • Jython:
      AdminControl.invoke(appManager, 'startApplication', 'myApplication')
      

    Command element Description
    $ Jacl operator for substituting a variable name with its value
    AdminControl Enable the manipulation of MBeans running in a WAS process
    invoke AdminControl command
    appManager Evaluate to the ID of the server specified in step number 1
    startApplication Attribute of the modify command
    myApplication Value of the startApplication attribute

  • Restart enterprise applications
  • wsadmin AdminControl
  • Install enterprise applications
  • Application administration scripts
  • Commands for the AdminControl object
  • Starting business-level applications using scripting