Shared library in Websphere 7

20,656

Solution 1

This is how shared libray is referenced.

Logon to the Websphere Application Server console.

  • Go to Environment -> Shared Libraries
    1. Create your own Shared Library. Add the classpath pointing to your JAR files.
    2. Apply and save this configuration.
    3. Now, Go to Servers -> Application Servers -> Select the server-> Java and Process Management -> ClassLoader.
    4. Click on that class loader.
    5. Click on the Shared Library References
    6. Click on Add.
    7. Add your shared library.
    8. Save and restart Websphere Servers.

Solution 2

Thanks all for HELP.. Finally i found solution.

  1. First remove all .jar files from your EAR even from different modules.
  2. Save all .jar files in some location.
  3. Go to WAS admin console > Environment > Shared Library and give a suitable name and mention classpath of all the required jar files. eg C:/libs/ojdbc14.jar. Restart WAS.
  4. Then deploy your EAR on WAS but don't start it.
  5. Go to Admin console > Application lists > select your application > Shared Library Reference, there you will see all the modules of your EAR. Select Checkbox next to it and Click Reference Library.
  6. Here you will see all the Shared library you saved earlier, add them to all modules.
  7. Now start your application.

Solution 3

A common problem that I faced with Shared Libraries was multiple jar occurrences. So, When installing web-apps under WAS, you can set the class loading policy in the options for that application (or globally on server/node level)

If the policy options are (search) "parent first" / "parent last" and one class loader per application or per war. The default is "parent first / war". If your web-app comes with all jars it needs you'll be better off with the policy set to "parent last / application". Also if you edit your web.xml to reflect changes, be sure to set "use binary configuration" otherwise it will always use what it stored during install.

You get the class loading option under Wepsphere applications>>click on the application name there you could see the class loader option.

Share:
20,656
blackberry dev
Author by

blackberry dev

Developer by day. Party hopper by night. In between I work to pay bills.

Updated on July 09, 2022

Comments

  • blackberry dev
    blackberry dev almost 2 years

    I am deploying my EAR on WAS 6 having 3 modules, in all of those 3 modules there are many jar files it makes my EAR heavy, to avoid that i want to use Shared Library wizard of Websphere. Please provide me link or tell me what changes i have to make in my code or resource or any .xml files. I am using below link to configure my JARs in Websphere Websphere Shared Library link 1 Link 2 Link 3

    Thanks in advance