Modify WAR class loader policies for applications using wsadmin.sh
Use scripting and the wsadmin tool to modify WAR class loader policies for applications.
Start the wsadmin scripting tool.
If an application is running, changing an application setting causes the application to restart. On stand-alone servers, the application restarts after we save the change. On multiple-server products, the application restarts after we 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.
Complete the steps in this topic to modify WAR class loader policies for an application.
Tasks
- Retrieve the configuration ID of the object to modify and set it to a variable.
For example, set the configuration ID to the dep variable. In this example, the object is the deployed application MyApp.
- Jacl:
set dep [$AdminConfig getid /Deployment:MyApp/]- Jython:
dep = AdminConfig.getid("/Deployment:MyApp/")
- Identify the deployed object and set it to a variable.
For example, set the deployed object to the depObject variable:
- Jacl:
set depObject [$AdminConfig showAttribute $dep deployedObject]- Jython:
depObject = AdminConfig.showAttribute(dep, "deployedObject")
- Show the current attribute values of the configuration object with the show command.
- Jacl:
$AdminConfig show $depObject warClassLoaderPolicyExample output:
{warClassLoaderPolicy MULTIPLE}- Jython:
AdminConfig.show(depObject, 'warClassLoaderPolicy')
Example output:
'[warClassLoaderPolicy MULTIPLE]'- Modify the attributes of the configuration object with the modify command.
- Jacl:
$AdminConfig modify $depObject {{warClassLoaderPolicy SINGLE}}- Jython:
AdminConfig.modify(depObject, [['warClassLoaderPolicy', 'SINGLE']])
- Save the configuration changes.
AdminConfig.save()- Optional: Verify the changes that we made to the attribute value with the show command.
- Jacl:
$AdminConfig show $depObject warClassLoaderPolicyExample output:
{warClassLoaderPolicy SINGLE}- Jython:
AdminConfig.show(depObject, 'warClassLoaderPolicy')Example output:
'[warClassLoaderPolicy SINGLE]'
Start the wsadmin scripting client wsadmin AdminConfig Commands for the AdminConfig object