32-bit JVM receiving Java objects from 64-bit JVM
Hi folks,
Question is: will there be problems for 32-bit JVM receiving Java objects from 64-bit JVM? and vice versa.
Our application client is running on 32-bit JVM, our server is running on 64-bit JVM. Client will send Java objects to server, and vice versa.
My past experience suggested when sending Java objects between client and server, both client and server needs to be compiled under the same JVM version. Any advice?
Christy
[464 byte] By [
Christya] at [2007-10-3 0:48:00]

> Question is: will there be problems for 32-bit JVM
> receiving Java objects from 64-bit JVM? and vice
> versa.
Nope, it will work fine. To quote the VM spec:
The choice of a specific word size, although platform-specific, is made at the implementation level, not as part of the Java Virtual Machine's design. It is not visible outside the implementation or to code compiled for the Java Virtual Machine.
YoGeea at 2007-7-14 17:42:59 >

> My past experience suggested when sending Java
> objects between client and server, both client and
> server needs to be compiled under the same JVM
> version. Any advice?
This is only a case if you omit explicit serialVersionUID. My advice is to ALWAYS specify it for classes you want to serialize over the wire or put into persistent storage. It is way too tricky to rely on default one to fail half a year later when some new programmer adds one new public method to a class.
Unless you need to deserialize already existing resources, there is no need to put any magic number in serialVersionUID - just put 1 for every class you create and possibly increase it by 1 every time you want to make incompatible version (which is not happening so often, as in real world you often try to stay as compatible as possible)
abiesa at 2007-7-14 17:42:59 >
