InvalidClassException:local class incompatible: stream classdesc serialVersionUI

local class incompatible: stream classdesc serialVersionUID = 1, local class serialVersionUID = 2427389723552147596

Invalid class due to serialization error cause

This error occurs for three reasons:

1. No value specified: BEAN is given by JDK without specifying the serialization value, and the client and server use different versions of JDK.

= "Solution: To use the same JDK

2. No specified value: a class is modified after the corresponding object has been serialized, and this attribute value is calculated by the JVM according to the relevant information of the class, and the calculation result of the modified class is the same as the class before modification. The results of the calculations are often different, causing the deserialization of the object to fail due to incompatible class versions.

= "Solution: To restart the application upgrade at the same time

3. The value is specified: the serialized value in the BEAN of the client and the BEAN of the server is different.

= "Solution: It is best to specify that in the JDK, you can use the serialver.exe tool in the bin directory of the JDK to generate this serialVersionUID. For Test.class, execute the command: serialver Test.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326168960&siteId=291194637