Modify class loader modes for applications using scripting


 

+

Search Tips   |   Advanced Search

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

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, we 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. We can run each script procedure individually, or combine several procedures to quickly develop new scripts.

 

Procedure

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.

Launch wsadmin

 

Code

### Jacl
set dep [$AdminConfig getid /Deployment:ivtApp/]
set depObject [$AdminConfig showAttribute $dep deployedObject]
set classldr [$AdminConfig showAttribute $depObject classloader]
$AdminConfig showall $classldr
$AdminConfig modify $classldr {{mode PARENT_LAST}}
AdminConfig save
$AdminConfig showall $classldr


### Jython
dep = AdminConfig.getid('/Deployment:ivtApp/')
depObject = AdminConfig.showAttribute(dep, 'deployedObject')
classldr = AdminConfig.showAttribute(depObject, 'classloader')
print AdminConfig.showall(classldr)
AdminConfig.modify(classldr, [['mode', 'PARENT_LAST']])
AdminConfig.save()
AdminConfig.showall(classldr)

 

Related tasks

Use the AdminConfig object for scripted administration

 

Related

Commands for the AdminConfig object