• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Serialization of object in network

 
Ranch Hand
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know whether it is a correct forum to post this question or not.
I have studied some material on java serialization of object. i have some doubts, if we have a server class which receives data coming from client and client class which has to send data to server. Message class is a serialized class class used to pass data over network.
1) My doubt is if i have to pass data from client to server which are running in different systems and different jvm(version is same) am i need to write message class in both sides with same package extension.
Eg: If my server program has to classes in it server.class and Message.class in a package com.xyz. and my client program running in a remote place which has client.class and Message.class in different package name com.abc . if i serialize and send message is there any trouble with DE-serialization.
2) If both JVM's versions are different then is serialization works.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, the Message class would need to be exactly the same on both sides. It would need to be in the same package. You should just re-use the code of the Message class on both sides.

It should work without any problem if the JRE versions on the server and client are different.
 
mallikarjun dontamsetti
Ranch Hand
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for reply i have a question how to detect a server which is running on a LAN environment.
 
reply
    Bookmark Topic Watch Topic
  • New Topic