Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > InvalidClassException COM.rsa.jsafe.SunJSSE_dr

Reply
Thread Tools

InvalidClassException COM.rsa.jsafe.SunJSSE_dr

 
 
Nomak
Guest
Posts: n/a
 
      04-18-2005
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(ObjectStrea mClass.java:463)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectI nputStream.java:1521)
at java.io.ObjectInputStream.readClassDesc(ObjectInpu tStream.java:1435)
at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1626)
at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1274)
at java.io.ObjectInputStream.defaultReadFields(Object InputStream.java:1845)
at java.io.ObjectInputStream.readSerialData(ObjectInp utStream.java:1769)
at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputSt ream.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
 
Reply With Quote
 
 
 
 
Arnaud Berger
Guest
Posts: n/a
 
      04-18-2005
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(ObjectStrea mClass.java:463)
> at java.io.ObjectInputStream.readNonProxyDesc(ObjectI nputStream.java:1521)
> at java.io.ObjectInputStream.readClassDesc(ObjectInpu tStream.java:1435)
> at

java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1626)
> at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1274)
> at

java.io.ObjectInputStream.defaultReadFields(Object InputStream.java:1845)
> at java.io.ObjectInputStream.readSerialData(ObjectInp utStream.java:1769)
> at

java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1646)
> at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1274)
> at java.io.ObjectInputStream.readObject(ObjectInputSt ream.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



 
Reply With Quote
 
 
 
 
Nomak
Guest
Posts: n/a
 
      04-18-2005
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?

 
Reply With Quote
 
Arnaud Berger
Guest
Posts: n/a
 
      04-18-2005
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?
>



 
Reply With Quote
 
Arnaud Berger
Guest
Posts: n/a
 
      04-18-2005
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?
>



 
Reply With Quote
 
Gordon Beaton
Guest
Posts: n/a
 
      04-18-2005
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
 
Reply With Quote
 
Nomak
Guest
Posts: n/a
 
      04-18-2005
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?

 
Reply With Quote
 
Arnaud Berger
Guest
Posts: n/a
 
      04-18-2005
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?
>



 
Reply With Quote
 
Nomak
Guest
Posts: n/a
 
      04-18-2005
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.

 
Reply With Quote
 
Arnaud Berger
Guest
Posts: n/a
 
      04-18-2005
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.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
InvalidClassException! Raga Java 10 08-22-2007 01:38 PM
Trouble with InvalidClassException when running application in Eclipse. aaronfude@gmail.com Java 1 06-18-2007 06:37 AM
InvalidClassException question Aidan Java 6 06-04-2004 07:49 PM
InvalidClassException while serializing Dave Rudolf Java 3 12-20-2003 10:14 PM
Help - java.io.InvalidClassException Mario Rosario Java 6 09-24-2003 06:25 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57