Serialization with runtime class loaders

Allgemeine Diskussionen, die nicht unbedingt etwas mit FPDF oder PDF allgemein zu tun haben müssen
JoeClark
Benutzer
Beiträge: 2
Registriert: Fr 3. Nov 2017, 13:39

Serialization with runtime class loaders

Beitragvon JoeClark » Mi 8. Nov 2017, 11:52

I have a problem with the java serialization.
This is the environment:
- The A program that loads a set of classes (using Class.forName command with custom classloader) and creates new instances for those classes.
All instances will be saved into List<Object> and sended through socket with writeObject method.
- The B program that loads the same set of classes (always in runtime mode, with Class.forName command) and receives the List<Object> from socket with readObject command.
So, the problem is that i receive an exception(ClassNotFoundException) during the readObject method execution. I suppose that when I load all classes at startup, my principal classloader don't uses the new classes (that have their own classloaders).
But, how can i read runtime loaded objects from readObject? How can i tell to readObject to use my additional classloaders?


I didn't find the right solution from the internet.

References:
[links deleded]

Benutzeravatar
Wirus!
Beiträge: 1492
Registriert: Do 22. Jun 2006, 18:23

Re: Serialization with runtime class loaders

Beitragvon Wirus! » Mi 8. Nov 2017, 13:14

Due this is a german forum - please post in german language
There is also no relation to FPDF or even PDF - the target of this page, so your "reference" links are deleted.


Zurück zu „Off-Topics“

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 3 Gäste