Registering classes on a new JVM through class loader. Problem : JVM throws class not found exception even after successful registration.
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ali_Khan
Posted On:   Wednesday, April 2, 2003 05:18 AM

I am developing a system that needs to register classes on another JVM. I am using the ClassLoader class to register the classes using their byte data. The classes are getting registered with no problem. I get the class object and I can call all the methods of the class Class through the newly formed object. The problem comes when I try to pass an object that belongs to the newly registered class from the original JVM to the other JVM. Now the class has been loaded but still as soon as the ObjectInputStream reads the object it throws the ClassNotFound exception. Plus the Class object can not be made by calling Class.forName(string classname) method but can be made using    More>>

I am developing a system that needs to register classes on another JVM. I am using the ClassLoader class to register the classes using their byte data. The classes are getting registered with no problem. I get the class object and I can call all the methods of the class Class through the newly formed object.



The problem comes when I try to pass an object that belongs to the newly registered class from the original JVM to the other JVM. Now the class has been loaded but still as soon as the ObjectInputStream reads the object it throws the ClassNotFound exception.




Plus the Class object can not be made by calling

Class.forName(string classname)



method but can be made using



Class.forName(string classname,

boolean initialize,

ClassLoader

the_loader_used_to_load_the_class)

This is after the class has been resistered by the Classloader.

   <<Less
About | Sitemap | Contact