This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Distributed Java and the fly likes Serialization details reqd. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Distributed Java
Reply Bookmark "Serialization details reqd." Watch "Serialization details reqd." New topic
Author

Serialization details reqd.

Kunaal A Trehan
Ranch Hand

Joined: Feb 04, 2004
Posts: 63
Hi All,

1.Consider a case where we are serializing an object on one machine and transporting to some other machine.On the other side besides class files,what all information do we need?

2.Another case lets suppose we are serializing an object and transporting to some other machine.But there class file does not conatin one method which that serialized object has.So in this case some exception wud be thrown.But will that exception wud be thrown when method call is invoked or when object is recreated.


Rgds
Kunal
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12268
    
    1
1. The class files for all of the objects serialized - the serialVersionUID in each must match that in the machine that wrote the object.
2. If the serialVersionUID's don't match you get an immediate InvalidClassException. If you force the serialVersionUIDs to match you would get another exception when the method was invoked.
See the discussion of java.io.Serializable in the JavaDocs
Bill


Java Resources at www.wbrogden.com
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Serialization details reqd.
 
Similar Threads
questions
questions
serialize objects or fields?
WebSphere Dynacache ClassCast exception
Serializable