Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

java.io.InvalidClassException  RSS feed

 
Barath Dhandapani
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Could anyone help me in the below error.

I am getting the below error when i try to execute my application in WAS 6.1, which was working fine in WAS 5.1

java.io.InvalidClassException: com.acnielsen.arch.config.service.Service; local class incompatible: stream classdesc serialVersionUID = 987267098049263698, local class serialVersionUID = 8439492350081587999

I had tried hardcoding both these values one by one, but it doesnt work even then.

Thanks in advance.

Regards,
Barath
 
A Shehadi
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't this a serialization problem?

I've encountered this sort of issues when changing classes of serialized objects on say, the client side, but not updating the same serialized class on the server side.

As far as I know, the serialVersionUID number is used to identify which "version" of the serialized class are you using to make sure both (client and server) are using the same one.
 
Barath Dhandapani
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are writing a java object in OutputStream,with defined serialVersionUID (4197884), and reading the java object again from the OutputStream.

But while reading we are getting the following exception


java.io.InvalidClassException: com.acnielsen.arch.config.service.ServiceConfig; local class incompatible: stream classdesc serialVersionUID = 2787697398409320177, local class serialVersionUID = 4197884

Is there any way to make the serialVersionUID compatible for stream classdesc and local class.

Thanks in advance.

Regards,
Barath


 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Specify the serialVersionUID explicitly:
Usually, you create one the first time (e.g. using the serialver.exe tool, or using your IDE). Afterwards, you simply keep it the same.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!