InvalidClassException COM.rsa.jsafe.SunJSSE_dr

Discussion in 'Java' started by Nomak, Apr 18, 2005.

  1. Nomak

    Nomak Guest

    Hello,

    With this source code:

    FileInputStream istream = new FileInputStream(fullPathFile);
    ObjectInputStream oistream = new ObjectInputStream(istream);
    Object o = oistream.readObject();

    i get:

    java.io.InvalidClassException: COM.rsa.jsafe.SunJSSE_dr; local class incompatible: stream classdesc serialVersionUID = -8679601579857181180, local class serialVersionUID = -7264885549576920566
    at java.io_ObjectStreamClass.initNonProxy(ObjectStreamClass.java:463)
    at java.io_ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1521)
    at java.io_ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
    at java.io_ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
    at java.io_ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    at java.io_ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
    at java.io_ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
    at java.io_ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
    at java.io_ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    at java.io_ObjectInputStream.readObject(ObjectInputStream.java:324)


    This is on a linux machine, while on a windows XP, it works (with the same file pointed by "fullPathFile").

    does anybody have an idea of anything which can make that happen?

    linux: 1.4.2_07
    windows: 1.4.2_06


    Thx
     
    Nomak, Apr 18, 2005
    #1
    1. Advertising

  2. Hi,

    You should probably try with the exact same version of JRE that was working
    on Windows (i.e 1.4.2_06
    ).

    The exception you got, simply means that the serialized object is not of the
    same version as the COM.rsa.jsafe.SunJSSE_dr class you have in your
    classpath (jre/lib/jsse.jar).

    Alternatively, maybe copying the jar from your windows JRE to the linux one
    could work.
    But, I don't think this is an advised trick.

    Regards,

    Arnaud

    "Nomak" <> a écrit dans le message news:
    20050418105549.2184036f@recif...
    > Hello,
    >
    > With this source code:
    >
    > FileInputStream istream = new FileInputStream(fullPathFile);
    > ObjectInputStream oistream = new ObjectInputStream(istream);
    > Object o = oistream.readObject();
    >
    > i get:
    >
    > java.io.InvalidClassException: COM.rsa.jsafe.SunJSSE_dr; local class

    incompatible: stream classdesc serialVersionUID = -8679601579857181180,
    local class serialVersionUID = -7264885549576920566
    > at java.io_ObjectStreamClass.initNonProxy(ObjectStreamClass.java:463)
    > at java.io_ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1521)
    > at java.io_ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
    > at

    java.io_ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
    > at java.io_ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    > at

    java.io_ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
    > at java.io_ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
    > at

    java.io_ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
    > at java.io_ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    > at java.io_ObjectInputStream.readObject(ObjectInputStream.java:324)
    >
    >
    > This is on a linux machine, while on a windows XP, it works (with the same

    file pointed by "fullPathFile").
    >
    > does anybody have an idea of anything which can make that happen?
    >
    > linux: 1.4.2_07
    > windows: 1.4.2_06
    >
    >
    > Thx
     
    Arnaud Berger, Apr 18, 2005
    #2
    1. Advertising

  3. Nomak

    Nomak Guest

    On Mon, 18 Apr 2005 11:05:06 +0200
    "Arnaud Berger" <> wrote:

    > Hi,
    >
    > You should probably try with the exact same version of JRE that was working
    > on Windows (i.e 1.4.2_06
    > ).
    >
    > The exception you got, simply means that the serialized object is not of the
    > same version as the COM.rsa.jsafe.SunJSSE_dr class you have in your
    > classpath (jre/lib/jsse.jar).
    >
    > Alternatively, maybe copying the jar from your windows JRE to the linux one
    > could work.
    > But, I don't think this is an advised trick.



    Thx, i did copy the jsse.jar from windows to linux and it works. But i can't ask to all our customers to have an exact version of the jdk. How can it be handled?

    More surprising is that other developpers (all using windows) can read the file with (jse1.5). How can it be explained? (my boss don't believe is a jdk version problem).

    Is there a jdk-version-serialVersionUID-map somewhere in the jdk that we don't use?
     
    Nomak, Apr 18, 2005
    #3
  4. Hi,

    There are two mechanisms for attributing a serial version :

    Either it is written in the code as a
    public final static long serialVersionUID=......;
    or it is automatically generated , based on the methods defintions and
    variables of the class.

    There is a tool , "serialver" in JDK's bin directory, that tells you about
    the version of a class :

    e.g

    serialver -classpath "jre"/lib/jsse.jar COM.rsa.jsafe.SunJSSE_dr .

    You should try this with different JREs' jsse.jar to see which ones have
    the same version for SunJSSE_dr .

    I think there is no way to change the version of this class by yourself.

    Regards,

    Arnaud


    "Nomak" <> a écrit dans le message news:
    20050418112716.40d61a9a@recif...
    > On Mon, 18 Apr 2005 11:05:06 +0200
    > "Arnaud Berger" <> wrote:
    >
    > > Hi,
    > >
    > > You should probably try with the exact same version of JRE that was

    working
    > > on Windows (i.e 1.4.2_06
    > > ).
    > >
    > > The exception you got, simply means that the serialized object is not of

    the
    > > same version as the COM.rsa.jsafe.SunJSSE_dr class you have in your
    > > classpath (jre/lib/jsse.jar).
    > >
    > > Alternatively, maybe copying the jar from your windows JRE to the linux

    one
    > > could work.
    > > But, I don't think this is an advised trick.

    >
    >
    > Thx, i did copy the jsse.jar from windows to linux and it works. But i

    can't ask to all our customers to have an exact version of the jdk. How can
    it be handled?
    >
    > More surprising is that other developpers (all using windows) can read the

    file with (jse1.5). How can it be explained? (my boss don't believe is a jdk
    version problem).
    >
    > Is there a jdk-version-serialVersionUID-map somewhere in the jdk that we

    don't use?
    >
     
    Arnaud Berger, Apr 18, 2005
    #4
  5. Just a last note,

    You may want to provide your serialized object to your customers , for any
    JDK they may use.

    Say obj_1-4-2_06.ser, obj_1-4-2_07.ser, obj_1-5-1.ser...

    Not a great solution, but still...

    Regards,

    Arnaud



    "Nomak" <> a écrit dans le message news:
    20050418112716.40d61a9a@recif...
    > On Mon, 18 Apr 2005 11:05:06 +0200
    > "Arnaud Berger" <> wrote:
    >
    > > Hi,
    > >
    > > You should probably try with the exact same version of JRE that was

    working
    > > on Windows (i.e 1.4.2_06
    > > ).
    > >
    > > The exception you got, simply means that the serialized object is not of

    the
    > > same version as the COM.rsa.jsafe.SunJSSE_dr class you have in your
    > > classpath (jre/lib/jsse.jar).
    > >
    > > Alternatively, maybe copying the jar from your windows JRE to the linux

    one
    > > could work.
    > > But, I don't think this is an advised trick.

    >
    >
    > Thx, i did copy the jsse.jar from windows to linux and it works. But i

    can't ask to all our customers to have an exact version of the jdk. How can
    it be handled?
    >
    > More surprising is that other developpers (all using windows) can read the

    file with (jse1.5). How can it be explained? (my boss don't believe is a jdk
    version problem).
    >
    > Is there a jdk-version-serialVersionUID-map somewhere in the jdk that we

    don't use?
    >
     
    Arnaud Berger, Apr 18, 2005
    #5
  6. On Mon, 18 Apr 2005 10:55:49 +0200, Nomak wrote:
    > FileInputStream istream = new FileInputStream(fullPathFile);
    > ObjectInputStream oistream = new ObjectInputStream(istream);
    > Object o = oistream.readObject();
    >
    > i get:
    >
    > java.io.InvalidClassException: COM.rsa.jsafe.SunJSSE_dr; local class
    > incompatible: stream classdesc serialVersionUID =
    > -8679601579857181180, local class serialVersionUID =
    > -7264885549576920566


    The communicating processes see two different versions of the classfile.

    /gordon

    --
    [ do not email me copies of your followups ]
    g o r d o n + n e w s @ b a l d e r 1 3 . s e
     
    Gordon Beaton, Apr 18, 2005
    #6
  7. Nomak

    Nomak Guest

    On Mon, 18 Apr 2005 11:32:28 +0200
    "Arnaud Berger" <> wrote:

    > Hi,
    >
    > There are two mechanisms for attributing a serial version :
    >
    > Either it is written in the code as a
    > public final static long serialVersionUID=......;
    > or it is automatically generated , based on the methods defintions and
    > variables of the class.
    >
    > There is a tool , "serialver" in JDK's bin directory, that tells you about
    > the version of a class :
    >
    > e.g
    >
    > serialver -classpath "jre"/lib/jsse.jar COM.rsa.jsafe.SunJSSE_dr .
    >
    > You should try this with different JREs' jsse.jar to see which ones have
    > the same version for SunJSSE_dr .
    >
    > I think there is no way to change the version of this class by yourself.
    >


    jar version which comes from windows:

    $ JDK=/usr/java/j2sdk1.4.2_07
    $ serialver -classpath $JDK/lib/jsse.jar COM.rsa.jsafe.SunJSSE_dr
    COM.rsa.jsafe.SunJSSE_dr: static final long serialVersionUID = -8679601579857181180L;


    original jar version:

    $ serialver -classpath ./jsse_OLD.jar COM.rsa.jsafe.SunJSSE_dr
    COM.rsa.jsafe.SunJSSE_dr: static final long serialVersionUID = -8679601579857181180L;

    It's the same id. The error message was:

    java.io.InvalidClassException: COM.rsa.jsafe.SunJSSE_dr; local class incompatible: stream classdesc serialVersionUID = -8679601579857181180, local class serialVersionUID = -7264885549576920566

    Who can i know to which class/jdk-version does "-7264885549576920566" is mapped to?
     
    Nomak, Apr 18, 2005
    #7
  8. Hi,

    This is pretty strange, I just tried a serialver pointing to the class of
    1.4 and then to the class of 1.5.
    The result is :

    in both cases , it returns me the ID of ITS JRE (from the JDK where
    serialver was found)

    So, for each JRE, try to use its won serialver tool :

    /usr/java/j2sdk1.4.2_07/bin/serialver COM.rsa.jsafe.SunJSSE_dr
    /usr/java/j2sdk1.4.2_06/bin/serialver COM.rsa.jsafe.SunJSSE_dr
    /usr/java/j2sdk1.5.0/bin/serialver COM.rsa.jsafe.SunJSSE_dr

    Regards,

    Arnaud


    "Nomak" <> a écrit dans le message news:
    20050418120226.5993eeb1@recif...
    > On Mon, 18 Apr 2005 11:32:28 +0200
    > "Arnaud Berger" <> wrote:
    >
    > > Hi,
    > >
    > > There are two mechanisms for attributing a serial version :
    > >
    > > Either it is written in the code as a
    > > public final static long serialVersionUID=......;
    > > or it is automatically generated , based on the methods defintions and
    > > variables of the class.
    > >
    > > There is a tool , "serialver" in JDK's bin directory, that tells you

    about
    > > the version of a class :
    > >
    > > e.g
    > >
    > > serialver -classpath "jre"/lib/jsse.jar COM.rsa.jsafe.SunJSSE_dr .
    > >
    > > You should try this with different JREs' jsse.jar to see which ones

    have
    > > the same version for SunJSSE_dr .
    > >
    > > I think there is no way to change the version of this class by yourself.
    > >

    >
    > jar version which comes from windows:
    >
    > $ JDK=/usr/java/j2sdk1.4.2_07
    > $ serialver -classpath $JDK/lib/jsse.jar COM.rsa.jsafe.SunJSSE_dr
    > COM.rsa.jsafe.SunJSSE_dr: static final long serialVersionUID

    = -8679601579857181180L;
    >
    >
    > original jar version:
    >
    > $ serialver -classpath ./jsse_OLD.jar COM.rsa.jsafe.SunJSSE_dr
    > COM.rsa.jsafe.SunJSSE_dr: static final long serialVersionUID

    = -8679601579857181180L;
    >
    > It's the same id. The error message was:
    >
    > java.io.InvalidClassException: COM.rsa.jsafe.SunJSSE_dr; local class

    incompatible: stream classdesc serialVersionUID = -8679601579857181180, loca
    l class serialVersionUID = -7264885549576920566
    >
    > Who can i know to which class/jdk-version does "-7264885549576920566" is

    mapped to?
    >
     
    Arnaud Berger, Apr 18, 2005
    #8
  9. Nomak

    Nomak Guest

    On Mon, 18 Apr 2005 12:17:24 +0200
    "Arnaud Berger" <> wrote:

    > Hi,
    >
    > This is pretty strange, I just tried a serialver pointing to the class of
    > 1.4 and then to the class of 1.5.
    > The result is :
    >
    > in both cases , it returns me the ID of ITS JRE (from the JDK where
    > serialver was found)
    >
    > So, for each JRE, try to use its won serialver tool :
    >
    > /usr/java/j2sdk1.4.2_07/bin/serialver COM.rsa.jsafe.SunJSSE_dr
    > /usr/java/j2sdk1.4.2_06/bin/serialver COM.rsa.jsafe.SunJSSE_dr
    > /usr/java/j2sdk1.5.0/bin/serialver COM.rsa.jsafe.SunJSSE_dr



    well, another developper did this on his jdk (1.5) on windows, and he found the same id.

    I don't understand what's happening.
     
    Nomak, Apr 18, 2005
    #9
  10. Maybe the serialization was made with pre-1.4 (older than JRE 1.4) JSSE
    which came as a separate download.

    http://java.sun.com/products/jsse/install.html

    Regards,

    Arnaud

    "Nomak" <> a écrit dans le message news:
    20050418131232.6965cde1@recif...
    > On Mon, 18 Apr 2005 12:17:24 +0200
    > "Arnaud Berger" <> wrote:
    >
    > > Hi,
    > >
    > > This is pretty strange, I just tried a serialver pointing to the class

    of
    > > 1.4 and then to the class of 1.5.
    > > The result is :
    > >
    > > in both cases , it returns me the ID of ITS JRE (from the JDK where
    > > serialver was found)
    > >
    > > So, for each JRE, try to use its won serialver tool :
    > >
    > > /usr/java/j2sdk1.4.2_07/bin/serialver COM.rsa.jsafe.SunJSSE_dr
    > > /usr/java/j2sdk1.4.2_06/bin/serialver COM.rsa.jsafe.SunJSSE_dr
    > > /usr/java/j2sdk1.5.0/bin/serialver COM.rsa.jsafe.SunJSSE_dr

    >
    >
    > well, another developper did this on his jdk (1.5) on windows, and he

    found the same id.
    >
    > I don't understand what's happening.
    >
     
    Arnaud Berger, Apr 18, 2005
    #10
  11. Nomak

    Nomak Guest

    On Mon, 18 Apr 2005 13:18:01 +0200
    "Arnaud Berger" <> wrote:

    > Maybe the serialization was made with pre-1.4 (older than JRE 1.4) JSSE
    > which came as a separate download.
    >
    > http://java.sun.com/products/jsse/install.html
    >


    thx but it's not the case, it was done with 1.4

    the one with jse 1.5 uninstalled its jdk, and installed 1.4.2_07 instead, and now he's having the same problem.


    regards
     
    Nomak, Apr 18, 2005
    #11
  12. Maybe you should serialize the object with 1.4.2_07 and try to deserialize
    with several different JREs.

    Regards,

    Arnaud

    "Nomak" <> a écrit dans le message news:
    20050418145328.251f87d1@recif...
    > On Mon, 18 Apr 2005 13:18:01 +0200
    > "Arnaud Berger" <> wrote:
    >
    > > Maybe the serialization was made with pre-1.4 (older than JRE 1.4) JSSE
    > > which came as a separate download.
    > >
    > > http://java.sun.com/products/jsse/install.html
    > >

    >
    > thx but it's not the case, it was done with 1.4
    >
    > the one with jse 1.5 uninstalled its jdk, and installed 1.4.2_07 instead,

    and now he's having the same problem.
    >
    >
    > regards
     
    Arnaud Berger, Apr 18, 2005
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. gg
    Replies:
    0
    Views:
    2,782
  2. Mario Rosario

    Help - java.io.InvalidClassException

    Mario Rosario, Sep 19, 2003, in forum: Java
    Replies:
    6
    Views:
    21,398
    SteveE
    Sep 24, 2003
  3. Dave Rudolf
    Replies:
    3
    Views:
    4,489
    Sudsy
    Dec 20, 2003
  4. Aidan
    Replies:
    6
    Views:
    1,099
    Aidan
    Jun 4, 2004
  5. Raga

    InvalidClassException!

    Raga, Sep 26, 2006, in forum: Java
    Replies:
    10
    Views:
    4,468
    shweta.naik
    Aug 22, 2007
Loading...

Share This Page