Modifying WAR class loader policies for applications using wsadmin scripting

You can use scripting and the wsadmin tool to modify WAR class loader policies for applications.

Before you begin

About this task

Attention: If an application is running, changing an application setting causes the application to restart. On stand-alone servers, the application restarts after you save the change. On multiple-server products, the application restarts after you save the change and files synchronize on the node where the application is installed. To control when synchronization occurs on multiple-server products, deselect Synchronize changes with nodes on the Console preferences page.
To modify WAR class loader policies for an application, perform the following steps:

Procedure

  1. Start the wsadmin scripting tool.
  2. Retrieve the configuration ID of the object that you want to modify and set it to the dep variable. For example:
    • Using Jacl:
      set dep [$AdminConfig getid /Deployment:MyApp/]
    • Using Jython:
      dep = AdminConfig.getid("/Deployment:MyApp/")
      
  3. Identify the deployed object and set it to the deployedObject variable. For example:
    • Using Jacl:
      set deployedObject [$AdminConfig showAttribute $dep deployedObject]
    • Using Jython:
      deployedObject = AdminConfig.showAttribute(dep, "deployedObject")
  4. Show the current attribute values of the configuration object with the show command, for example:
    • Using Jacl:
      $AdminConfig show $deployedObject warClassLoaderPolicy
      Example output:
      {warClassLoaderPolicy MULTIPLE}
    • Using Jython:
      AdminConfig.show(deployedObject, 'warClassLoaderPolicy')
      Example output:
      '[warClassLoaderPolicy MULTIPLE]'
  5. Modify the attributes of the configuration object with the modify command, for example:
    • Using Jacl:
      $AdminConfig modify $deployedObject {{warClassLoaderPolicy SINGLE}}
    • Using Jython:
      AdminConfig.modify(deployedObject, [['warClassLoaderPolicy', 'SINGLE']])
  6. Save the configuration changes.
    Use the following command example to save your configuration changes:
    AdminConfig.save()
  7. Verify the changes that you made to the attribute value with the show command, for example:
    • Using Jacl:
      $AdminConfig show $deployedObject warClassLoaderPolicy
      Example output:
      {warClassLoaderPolicy SINGLE}
    • Using Jython:
      AdminConfig.show(deployedObject, 'warClassLoaderPolicy')
      Example output:
      '[warClassLoaderPolicy SINGLE]'



In this information ...


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic    

Terms of Use | Feedback

Last updated: Oct 21, 2010 10:04:34 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=compass&product=was-nd-mp&topic=txml_warclass
File name: txml_warclass.html