Configure a shared library
The following example configures an appserver to use a shared library.
- Identify the server id:
set serverid [$AdminConfig getid /Cell:cellname/Node:nodename/Server:servername/]- Create the shared library in the server:
$AdminConfig create Library $serverid {{name SharedLibraryName} {classPath /usr/local/lib/}}- Identify the appserver id from the server.
set appServerid [$AdminConfig list ApplicationServer $server]- Identify the class loader in the appserver and assign it to the classLoader variable.
To use the existing class loader associated with the server, the following commands use the first class loader:
set classLoaders [$AdminConfig showAttribute $appServerid classloaders]
set classLoader [lindex $classLoaders 0]- Create a new class loader, by doing the following:
set classLoader [$AdminConfig create Classloader $appServerid {{mode PARENT_FIRST}}]- Associate the created shared library with the appserver through the class loader.
$AdminConfig create LibraryRef $classLoader {{libraryName SharedLibraryName} {sharedClassloader true}}- Save changes:
$AdminConfig save