You can modify class loader modes for an application with
scripting and the wsadmin tool.
Before you begin
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.
A biblioteca de scripts fornece um conjunto de procedimentos para automatizar as funções de administração mais comuns. É possível executar
cada procedimento de script individualmente, ou combinar diversos procedimentos para
desenvolver rapidamente novos scripts.
About this task
Attention: Se um aplicativo estiver em execução, a alteração
de uma configuração do aplicativo fará com que ele seja reiniciado. Em servidores
independentes, o aplicativo será reiniciado depois de salvar a alteração. Em produtos de vários servidores, o aplicativo reinicia após você salvar a alteração e os arquivos sincronizarem no nó onde o aplicativo está instalado. Para controlar quando a sincronização
ocorrerá em produtos com vários servidores, cancele a seleção de Sincronizar Alterações com Nós na página de Preferências do Console.
Procedure
- Inicie a ferramenta de script wsadmin.
- 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:ivtApp/]
Using Jython:
dep = AdminConfig.getid('/Deployment:ivtApp/')
- Identify the deployed object and set it to the depObject variable.
For example:
Using Jacl:
set depObject [$AdminConfig showAttribute $dep deployedObject]
Using Jython:
depObject = AdminConfig.showAttribute(dep, 'deployedObject')
- Identify the class loader and set it to the classldr variable.
For example:
Using Jacl:
set classldr [$AdminConfig showAttribute $depObject classloader]
Using Jython:
classldr = AdminConfig.showAttribute(depObject, 'classloader')
- Show the current attribute values of the configuration
object with the showall command, for example:
Using Jacl:
$AdminConfig showall $classldr
Example
output:
{libraries {}} {mode PARENT_FIRST}
Using Jython:
print AdminConfig.showall(classldr)
Example
output:
[libraries []] [mode PARENT_FIRST]
- Modify the attributes of the configuration object with
the modify command, for example:
Using Jacl:
$AdminConfig modify $classldr {{mode PARENT_LAST}}
Using Jython:
AdminConfig.modify(classldr, [['mode', 'PARENT_LAST']])
- Save the configuration changes.
Utilize o seguinte exemplo de comando para salvar suas alterações de
configuração:
AdminConfig.save()
- Verify the changes that you made to the attribute value
with the showall command, for example:
Using Jacl:
$AdminConfig showall $classldr
Example
output:
{libraries {}} {mode PARENT_LAST}
Using Jython:
AdminConfig.showall(classldr)
Example
output:
[libraries []] [mode PARENT_LAST]