Win a copy of Spring Boot in Practice this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Doubt about Serialisation

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi All,

i just wanted to know that if a object is serialized using one version of JVM and Desrialized using other version. does deserialization will be successful.
is serialization depends upon JVM version??
please give me any docs or links in support of it.
 
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According docs serialization does no depends upon JVM version.You can serialize one one JVM and deserialize on other JVM.
 
Abhishek Pratap
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any links to see the same..
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

According docs serialization does no depends upon JVM version.



I don't think that's correct in the general case. If you serialize on JDK 1.3 and deserialize on 1.4 you may very well have problems, if the classes in question have changed between releases.
You should be OK if you use your own identical classes on both sides (although there may be byte-order problems if you transfer between, say Unix and Windows; I'm not sure about that).

If the objects are Beans, have a look at the java.beans.XMLEncoder/Decoder classes which provide long-term stable serialization.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic