How to enable child-first class loading in WSO2 Application Server or Axis2
By default, WSO2 Application Server (or Axis2) uses parent-first class loading mechanism. If you deploy an AAR service, which can load classes from the following locations.
CARBON_HOME/lib (CARBON_HOME is the location where you installed WSO2 Application Server) CARBON_HOME/repository/deployment/server/axis2services/lib AAR service/lib (lib directory under your service archive)
If your service implementation class has a package import for a class, which is available in both CARBON_HOME/repository/deployment/server/axis2services/lib and the lib directory under service archive, the class placed under CARBON_HOME/repository/deployment/server/axis2services/lib will get loaded. Which means, the parent class always get loaded first. The class loading sequence is CARBON_HOME/lib ---> CARBON_HOME/repository/deployment/server/axis2services/lib -----> AAR service/lib
Sometimes, we want to load the class from service archive lib first without loading the class which is available ei