Description
Currently Axis2 follows the parent first class loading for service and module loading.
The reason for this is it uses DeploymentClassLoader loader which is extended from the ClassLoader class.
The loadClass method of the ClassLoader class looks like this.
protected synchronized Class<?> loadClass(String name, boolean resolve)
throws ClassNotFoundException
{
// First, check if the class has already been loaded
Class c = findLoadedClass(name);
if (c == null) {
try {
if (parent != null)
else
{ c = findBootstrapClass0(name); }} catch (ClassNotFoundException e)
{ // If still not found, then invoke findClass in order // to find the class. c = findClass(name); } }
if (resolve)
return c;
}
it first check for parent class loader classes and then for its classes. So we can add child first class loading simply reversing this order in a override loadClass method as follows.
protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
Class c = findLoadedClass(name);
if (c == null) {
try
catch (Exception e)
{ c = super.loadClass(name, resolve); } }
return c;
}
Attachments
Attachments
Issue Links
- is depended upon by
-
AXIS2-4917 Provide proper documentation on deploying Axis2 in WebSphere
- Resolved