Forums Register Login

java.io.InvalidClassException

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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


+Pie Number of slices to send: Send
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.
Amateurs built google. Professionals built the titanic. We can't find the guy that built this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 9772 times.
Similar Threads
PeerGoneException
.UnmarshalException
local class incompatible error
Jasper Reports
serialVersionUID error message when executing swing based application from netbeans
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 06:14:23.