Classloader Problems

Posted by Hariharan Vadivelu on

You will most probably run into these issues when you have a custom jar or an open source jar that you would like to use in you custom WCS logic, here are some basics of how WCS classloader and possible steps to solve the classloader issue.


In general there are two different classloaders that load custom jar files that you may place under stores.war/web-inf/lib - The classloader for Stores WAS loads everything under this directory to classpath.
By default, a Web module has its own Web application archive (WAR) class loader to load the contents of the Web module, which are in the WEB-INF/classes and WEB-INF/lib directories.

This can be used as a technique to quickly deploy your customization to a WC server environment by creating jar of patch that overrides a implementation which was packaged in  WebSphereCommerceServerExtensionsLogic.jar and drop it in stores.war/web-inf/lib

you can also place custom jars under following location, but these would require registering the modules
installedApps/WC_guest_cell/WC_guest.ear
installedApps/WC_guest_cell/WC_guest.ear/lib

InitializationServlet.war is OOB WAR file which is used during startup, OOB EJB's are referenced in META-INF file of this WAR file

If you have the utiliy jar being reference and used in any of the class files in these jars you will have to make an entry in META-INF file of corresponding Jar file.

WebSphereCommerceServerExtensionsData.jar
WebSphereCommerceServerExtensionsLogic.jar

MANIFEST.MF from Stores.war needs to reference these jars if they will be placed right under the WC_ear directory.                          

Sill have a classloader problem?
and enable the trace components com.ibm.ws.classloader.*=all and work with your IBM support for diagnose the issue further.

http://www-01.ibm.com/support/docview.wss?uid=swg21296577





4 comments:

  1. It was very nice blog to learn about SAP HR.Thanks for sharing new things.SAP HR

    ReplyDelete
  2. This is very informative. I just recently encountered a problem with the classloader and don't even have the solution to figure it out. Thanks for these I have now the idea to troubleshoot this problem just by having open source jar.

    ReplyDelete
  3. I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in TECHNOLOGY , kindly contact us http://www.maxmunus.com/contact
    MaxMunus Offer World Class Virtual Instructor led training on TECHNOLOGY. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
    For Demo Contact us.
    Saurabh Srivastava
    MaxMunus
    E-mail: saurabh@maxmunus.com
    Skype id: saurabhmaxmunus
    Ph:+91 8553576305 / 080 - 41103383
    http://www.maxmunus.com/


    ReplyDelete