Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Serialization

 
sarma kiran
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Suppose when there is a Employee POJO class. I have serialized the Employee Object to the file System. I have moved that file to the different system. If i want to deserialize the object, do i need to include the Employee class file in the class path.
 
Rob Spoor
Sheriff
Posts: 20822
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you check the Javadoc page for ObjectInputStream and its readObject method you will see that it will throw a ClassNotFoundException if "Class of a serialized object cannot be found." So yes, the class needs to be available on the system where you deserialize the object.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!