12.3.3 Shared libraries
Shared libraries are files used by multiple applications. Examples of shared libraries are commonly used frameworks like Apache Struts or log4j. You use shared libraries typically to point to a set of JARs and associate those JARs to an application, a Web module, or the class loader of an appserver. Shared libraries are especially useful when you have different versions of the same framework you want to associate to different applications.
Shared libraries are defined using the administration tools. They consist of a symbolic name, a Java class path, and a native path for loading JNI libraries. They can be defined at the cell, node, server, or cluster level. However, simply defining a library does not cause the library to be loaded. You must associate the library to an application, a Web module, or the class loader of an appserver for the classes represented by the shared library to be loaded. Associating the library to the class loader of an appserver makes the library available to all applications on the server.
If you associate a shared library to an application, do not associate the same library to the class loader of an appserver.
You can associate the shared library to an application in one of two ways:
- Use the administration tools. The library is added using the Shared libraries references link under the References section for the enterprise application.
- Use the manifest file of the application and the shared library. The shared library contains a manifest file that identifies it as an extension. The dependency to the library is declared in the application's manifest file by listing the library extension name in an extension list. For more information about this method, search for installed optional packages in the Information Center.
Shared files are associated with the class loader of an appserver using the administrative tools. The settings are found in the Server Infrastructure section. Expand the Java and Process Management. Select Class loader and then click the New button to define a new class loader. Once you have defined a new class loader, you can modify it and, using the Shared library references link, you can associate it to the shared libraries we need.
See Step 4: Sharing utility JARs using shared libraries for more details.