Modify WAR class loader policies for applications using scripting


Use scripting and wsadmin to modify WAR class loader policies for applications.

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:

 

  1. Launch the wsadmin scripting tool using the Jython scripting language.

  2. Retrieve the configuration ID of the object to modify and set it to the dep variable. For example:

    • Jacl...

      set dep [$AdminConfig getid /Deployment:MyApp/]

    • Jython...

      dep = AdminConfig.getid("/Deployment:MyApp/")

  3. Identify the deployed object and set it to the deployedObject variable. For example:

    • Jacl...

      set deployedObject [$AdminConfig showAttribute $dep deployedObject]

    • Jython...

      deployedObject = AdminConfig.showAttribute(dep, "deployedObject")

  4. Show the current attribute values of the configuration object with the show command...

    • Jacl...

      $AdminConfig show $deployedObject warClassLoaderPolicy

      Example output:

      {warClassLoaderPolicy MULTIPLE}

    • Jython...

      AdminConfig.show(deployedObject, 'warClassLoaderPolicy')

      Example output:

      '[warClassLoaderPolicy MULTIPLE]'

  5. Modify the attributes of the configuration object with the modify command...

    • Jacl...

      $AdminConfig modify $deployedObject {{warClassLoaderPolicy SINGLE}}

    • Jython...

      AdminConfig.modify(deployedObject, [['warClassLoaderPolicy', 'SINGLE']])

  6. Save the configuration changes...

    AdminConfig.save()

  7. Verify the changes that you made to the attribute value with the show command...

    • Jacl...

      $AdminConfig show $deployedObject warClassLoaderPolicy

      Example output:

      {warClassLoaderPolicy SINGLE}

    • Jython...

      AdminConfig.show(deployedObject, 'warClassLoaderPolicy')

      Example output:

      '[warClassLoaderPolicy SINGLE]'

 

Related tasks


Use the AdminConfig object for scripted administration

 

Related


Commands for the AdminConfig object