I wrote a custom classloader to dynamically load classes
present in a certain directory( *not* present in the CLASSPATH). ( So that I need not restart AppServer, everytime I add a new class)
I am able to succefully load a class( say A.class), *BUT* when that class(A.class) uses other classes(B.class) present in that directory, then it is reporting classnotfound exception.
I believe A.class is delegating the the work of finding B.class to the parent classloader instead of the "custom classloader".
Is there any method, by which you can force a class to use the custom classloader or anything like that. Can anyone pls advise/suggest me what whould be a right approach
In the Class Object there is a method.
public static Class forName(String name,
Try to load B.class using the same classloader since
the same class loaded by different classloader is treated
as two different classes.
I have no control over A.class and B.class. A.class uses B.class.