1
Answer

Call on remote object after deserialization fails

Ask a question
Peter Minev

Peter Minev

15y
3.3k
1

Hi,

I have serialized remote object. I deserialize it OK:

bufferEvent = (Event)binReader.Deserialize(inStream);

After that I get remote object of the same type, and I want to copy the data from the buffer object to the remote object, in order again all clients to maniplate the "old" remote object, which was serialized on previous program close:

this.thisEvent = (Event)Activator.GetObject(typeof(Event), "tcp://localhost:8086/Hi"); - this line is ok, I get remote object

//now I call set method on the remote object - failure :(

List<Candidate> candidatesList = bufferEvent.getCandidates();

this.thisEvent.setCandidates(candidatesList); - this line throws Exception

"An unhandled exception of type 'System.NullReferenceException' occurred in mscorlib.dl. Additional information: Object reference not set to an instance of an object."

It is very strange, because if I make the same call but with setter function which sets not list, but only one reference to object it passes OK, i.e.

this call executes OK:

this.thisEvent.setEventTime(bufferEvent.getEventTime());

Do you have an idea why calling set method with List parameter fails with such Exception?

 

Thanks, Peter


Answers (1)