Administer shared libraries

 

Overview

WebSphere Application Server uses shared libraries to define code that is used by the enterprise applications, but not packaged within those applications. For example, a utility library, such as IBM Toolbox for Java classes, could be packaged as a shared library. Shared libraries can be associated with an enterprise application or an appserver. If a shared library is associated with an appserver, it is accessible to all of the enterprise applications deployed on that server.

Shared library files in WebSphere Application Server consist of a symbolic name, a classpath, and a path for loading JNI libraries.

You can define a shared library at the cell, node, or server level. Defining a library at one of the three levels does not cause the library to be placed into the appserver's classloader. To make the classes in the library available to an application or server, create an association between the library and the application or server.

A separate classloader is used for shared libraries that are associated with an appserver. This classloader is the parent of the application classloader, and the WebSphere Application Server extensions classloader is its parent. Shared libraries that are associated with an application are loaded by the application classloader.

 

Create shared libraries

To create a shared library, follow these steps:

  1. Start the administrative console.

  2. Expand...

    Environment | Shared Libraries

  3. Specify the scope for which you want to define a library and click Apply.

  4. Click New.

  5. Specify a name and classpath for the shared library. You can also specify other properties on this page.

  6. Click OK.

  7. Save the configuration.

 

Modify shared libraries

To modify a shared library, follow these steps:

  1. Start the administrative console.

  2. Expand...

    Environment | Shared Libraries

  3. Specify the scope contains the library that you want to modify and click Apply.

  4. Click the name of the shared library that you want to modify.

  5. Make the changes.

  6. Click OK.

  7. Save the configuration.

 

Remove shared libraries

To remove a shared library, follow these steps:

  1. Start the administrative console.

  2. Expand...

    Environment | Shared Libraries

  3. Specify the scope for that contains the library that you want to remove and click Apply.

  4. Select the checkbox for the shared library that you want to remove.

  5. Click Delete.

  6. Save the configuration.

 

Associate a shared library with an appserver

To associate a shared library with an appserver, follow these steps:

  1. Start the administrative console.

  2. Expand...

    Servers | Application Servers

  3. On the Application Servers page, click the name of the server to which you want to add a shared library.

  4. On the appserver's detail page, click Classloader.

  5. On the Classloader page, click New.

  6. Select the Classloader mode and click OK.

  7. On the Classloader page, click the classloader that you created. If this is the first classloader that you create for the appserver, it is named classloader_1.

  8. On the classloader's detail page, click Libraries.

  9. On the Libraries page, click Add.

  10. Select the shared library that you want to associate with the appserver.

  11. Click OK.

  12. Save the configuration.

To remove an association to a shared library, follow these steps:

  1. On the Libraries page, select the checkbox for the library that you want to remove.

  2. Click Remove.

  3. Save the configuration.

 

Associate a shared library with an application

To associate a shared library with an application, follow these steps:

  1. Start the administrative console.

  2. Expand...

    Applications | Enterprise Applications

  3. On the Enterprise Applications page, click the name of the application to which you want to add a shared library.

  4. On the application's detail page, click Libraries.

  5. On the Libraries page, click Add.

  6. Select the shared library that you want to associate with the application.

  7. Click OK.

  8. Save the configuration.

To remove an association to a shared library, follow these steps:

  1. On the Libraries page, select the checkbox for the library that you want to remove.

  2. Click Remove.

  3. Save the configuration.