Network Deployment (Distributed operating systems), v8.0 > Scripting the application serving environment (wsadmin) > Configure applications using scripting


Modify class loader modes for applications using wsadmin scripting

We can modify class loader modes for an application with scripting and wsadmin.sh.

There are two ways to complete this task. The example in this topic uses the AdminConfig object to create and configure a shared library. Alternatively, you can use the createSharedLibrary script in the AdminResources script library to configure shared libraries.

The scripting library provides a set of procedures to automate the most common administration functions. You can run each script procedure individually, or combine several procedures to quickly develop new scripts.

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.


Procedure

  1. Start wsadmin.sh.

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

      ### Jacl

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

      ### Jython

      dep = AdminConfig.getid('/Deployment:ivtApp/')
      

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

      ### Jacl

      set depObject [$AdminConfig showAttribute $dep deployedObject]
      

      ### Jython

      depObject = AdminConfig.showAttribute(dep, 'deployedObject')
      

  4. Identify the class loader and set it to the classldr variable. For example:

      ### Jacl

      set classldr [$AdminConfig showAttribute $depObject classloader]
      

      ### Jython

      classldr = AdminConfig.showAttribute(depObject, 'classloader')
      

  5. Show the current attribute values of the configuration object with the showall command, for example:

      ### Jacl

      $AdminConfig showall $classldr
      

      Example output:

      {libraries {}} {mode PARENT_FIRST}
      

      ### Jython

      print AdminConfig.showall(classldr)
      

      Example output:

      [libraries []] [mode PARENT_FIRST]
      
      

  6. Modify the attributes of the configuration object with the modify command, for example:

      ### Jacl

      $AdminConfig modify $classldr {{mode PARENT_LAST}}
      

      ### Jython

      AdminConfig.modify(classldr, [['mode', 'PARENT_LAST']])
      

  7. Save the configuration changes.

    Save the configuration changes:

    AdminConfig.save()
    

  8. Verify the changes that you made to the attribute value with the showall command, for example:

      ### Jacl

      $AdminConfig showall $classldr
      

      Example output:

      {libraries {}} {mode PARENT_LAST}
      

      ### Jython

      AdminConfig.showall(classldr)
      

      Example output:

      [libraries []] [mode PARENT_LAST]
      


Start the wsadmin scripting client using wsadmin.sh
Use the wsadmin scripting AdminConfig object for scripted administration


Related


Commands for the AdminConfig object using wsadmin.sh

+

Search Tips   |   Advanced Search