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 application server.
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.
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 application server for the classes represented by the shared library to be loaded. Associating the library to the class loader of an application server makes the library available to all applications on the server.
Note: If you associate a shared library to an application, do not associate the same library to the class loader of an application server.
You can associate the shared library to an application in one of two ways:
- You can use the administration tools. The library is added using the Shared libraries references link under the References section for the enterprise application.
- You can 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.