wood burning stoves
The moose likes Java in General and the fly likes InvalidClass Exception in javax .crypto. spec.SecretKeySpec Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "InvalidClass Exception in javax .crypto. spec.SecretKeySpec" Watch "InvalidClass Exception in javax .crypto. spec.SecretKeySpec" New topic

InvalidClass Exception in javax .crypto. spec.SecretKeySpec

Ramachandran Vaidyanathan

Joined: Dec 01, 2003
Posts: 9
Hi Friends,
Iam getting the following invalidclassexception while connecting from tomcat4.1 to websphere 3.5.6
java.io.InvalidClassException: javax.crypto.spec.SecretKeySpec; local class incompatible: stream classdesc serialVersionUID = 4363931942414077710, local class serialVersionUID = 6577238317307289933
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:459)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:152
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
Can somebody help me ASAP.....

Thanks and Regards,<br />Ramachandran Vaidyanathan
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
That problem indicates that you have incompatible versions of javax.crypto.spec.SecretKeySpec. This happens when you try to serialize an object of a particular class and the serialVersionUID is different on the the receiving end of the socket. You need to be sure that javax.crypto.spec.SecretKeySpec is the same on Tomcat and WebSphere, which it wouldn't be in your case since Tomcat 4.1 uses Java 1.4 and WebSphere 3.5.6 uses 1.2 I believe. I don't believe that SecretKeySpec was around until 1.4. Is the exception being thrown in WebSphere?

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Ramachandran Vaidyanathan

Joined: Dec 01, 2003
Posts: 9
The Exception is thrown in Tomcat and not in Websphere.
I agree. Here's the link: http://aspose.com/file-tools
subject: InvalidClass Exception in javax .crypto. spec.SecretKeySpec
It's not a secret anymore!