E
enzo.660
Hey!
I'm using the Reflection API
I load a class called 'SubClass' which exists in a directory called
'subdir' at run-time from my program
--------------------------------------------------------------------
----------
CustomClassLoader loader = new CustomClassLoader();
Class classRef = loader.loadClass("SubClass");
----------------------------------------------
--------------------------------
class CustomClassLoader extends ClassLoader. I have defined
'findClass(String className)' method in CustomClassLoader.
This is what 'findClass(String className)' returns:
defineClass (className,byteArray,0,byteArray.length);
'byteArray' is of type byte[] and has the contents of subdir/SubClass.
the problem:
-----------------
The program runs fine if SubClass does not extend any class.
If however, SubClass extends another class, the program throws a
NoClassDefFoundError. How does one take care of the inheritance here?
Help appreciated in advance..
Thanks!
I'm using the Reflection API
I load a class called 'SubClass' which exists in a directory called
'subdir' at run-time from my program
--------------------------------------------------------------------
----------
CustomClassLoader loader = new CustomClassLoader();
Class classRef = loader.loadClass("SubClass");
----------------------------------------------
--------------------------------
class CustomClassLoader extends ClassLoader. I have defined
'findClass(String className)' method in CustomClassLoader.
This is what 'findClass(String className)' returns:
defineClass (className,byteArray,0,byteArray.length);
'byteArray' is of type byte[] and has the contents of subdir/SubClass.
the problem:
-----------------
The program runs fine if SubClass does not extend any class.
If however, SubClass extends another class, the program throws a
NoClassDefFoundError. How does one take care of the inheritance here?
Help appreciated in advance..
Thanks!