0

Let's say I have Class A which is implementing Serialization interface. and class is used so many places. (Services, micro-services).

Now I have added one attribute to the class A, and getting Error:

local class incompatible: stream classdesc serialVersionUID = 6432914265839977553, local class serialVersionUID = -1514387542175529607

Here i don't want to deploy other services who are using class A. and solve this problem.

I know adding serialVersionUID will fix the problem, but for that need to deploy all the other services who are using this class.

I want to fix this without impacting other services who are using this.

I have already gone through this link:

java.io.InvalidClassException: local class incompatible:

user2888996
  • 417
  • 8
  • 20
  • @KarthikeyanVaithilingam I have already gone through, but in that case i need to deploy both client and server. – user2888996 Sep 03 '19 at 07:44
  • 'Need to deploy all the other services who are using this class: no you don't. You only have to deploy the class where you want the new attribute to be used. You have to set the `serialVersionUID` of the new class to what it was by default before you changed it. So any services that don't use the new attribute don't have to be redeployed and won't get this error. – user207421 Sep 04 '19 at 01:40

0 Answers0