Is the Java serialized object in J++ and J# are compatible?

Hi,
I want migrate my existing J++ project to J#. But since the data stored in serialized object, my J# upgraded application cannot read those object produced by J++. Is there any way that my J# application can read j++ serialized object

I have watch the produced object in notepad, the produced object is very similar. Just a few byte different. did I do something wrong in the setting
Thank you


Answer this question

Is the Java serialized object in J++ and J# are compatible?

  • Mandira

    Hi,

    I checked that the VJ++-VJ# cross serialization with respect to Hashtable and Integer doesnt work. Actually serialization depends on internal structure of the class, and the internal structure of the class might have got changed, thats why the serialized data in VJ++ is not getting properly deserialized in VJ#

    Coming back to your specific question, there is no setting to make J# generate J++ readable object.
    If there is user defined class in VJ++ without any jdk types, then for sure it will deserialize in VJ#. However for jdk types, serialization between VJ++ and VJ# might not work with all the jdk types.

    Thanks,

  • Scarlett Lee - MSFT

    Thank you for your reply.
    I try the following code and I find the serialize of int,boolean,String is okay. But if the class include Integer, Hashtable etc and not null ( if the variable is null, it is still okay ), J++ and J## cannot communicate.
    I have use notepad to read the generated code and there is really a litte different.

    Is there any setting to make J# generate J++ readable object

    public class MyClass implements Serializable
    {

     public int i;
     public java.util.Hashtable h=new java.util .Hashtable (); 
     public Integer j;
     

     public MyClass()
     {
       j = new Integer(1);
     }

     public MyClass(int _i, int _j, int _k)
     {
     }
    }

    if take out the hashtable and integer, everything work fine


  • Onur Gorur


    Are you serializing user-defined classes or JDK types as well It would be great if you can provide specific types which are not getting deserialized properly.

    Thanks,



  • Is the Java serialized object in J++ and J# are compatible?