FreeKB - IBM WebSphere Getting Started with Shared Library
IBM WebSphere - Getting Started with Shared Library

A shared library is a file or a collection of files that can be used (shared) by multiple applications. For example, let's say you have an EJB, and the EJB backend is produced via EJBBackend.jar. You could create a shared library so that multiple applications can use the EJBBackend.jar.


Create the shared library

In the WebSphere admin console, expand Environment and select Shared libraries. Select an appropriate scope. Select New. Give your shared library a name, and in classpath, enter the path to the file being shared, or the path to the directory that contains the files being shared. Select OK. Select Save.

In this example, a shared library named EJB is created, which contains a reference to EJBBackend.jar.


Configure a JVM to use the Shared Library

In the WebSphere admin console, expand Servers > Server types > your application server > Java and Process ManagementClass Loader > New > Classes loaded with parent loader first or Classes loaded with local class loader first > OK.

Note: "Classes loaded with parent loader first" is the default selection. If the JVM is configured with local class loader, then the shared library will be loaded before the local class loader. 

Select the newly created classloader > Shared library references > Add > your Shared Library > OK > SaveRestart the JVM for this change to take effect.

In this example, the JVM named was1 is configured to use the EJB shared library.


Configure an Application to use the Shared Library

In the WebSphere admin console, expand Applications > Enterprise applications > Shared library references. From the list of available shared libraries, highlight your shared library, and move the shared library into selected. Select OKRestart the application for this change to take effect.

Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter 72010 in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   |