Exception information:
Caused by:java. io. InvalidClassException: com. eastcom xxx. xxxxxx. bean. AlarmReq; local class incompatible: stream classdesc serialversionUID =8050743254081999660, local class seriaiversionuId = 6638111461888145730
Cause of exception:
when serializing objects, they will be stored in redis memory, and then through redistemplate getValueSerializer(). The deserialize () method deserializes the data to the bean object. If the current bean object changes, that is, if an attribute is added, the serialVersionUID will change.
Because the serialVersionUID of this class is generated by the JVM according to the class name and the hash value of its attributes during serialization. When the properties of the class change, the serialVersionUID will also change accordingly, resulting in an error when the serialVersionUID does not match when the old data in redis is deserialized.
Solution:
I. Add code before the error reporting class property
private static final long serialVersionUID = 8050743254081999660L;
Here the UID corresponds to the above stream classdesc serialversionUID
ii.Clear the redis data linked by the current service.Clear the redis data linked by the current service.
Read More:
- The java springboot websocket service server actively closes the connection and causes java.io.EOFException to be thrown
- How to Solve java server error (java application Run Normally)
- Java learning unreported exception java.io.IOException ; must be caught or declared to be thrown
- How to Solve Flynk Task Java verifyerror 209 error
- [Solved] Read the resources resource and convert it to file error: java.io.filenotfoundexception
- How to Solve Java Error \ufeff
- JAVA: How to Solve Foreach Loop Remove/add Element Error
- How to Solve Java Runtime (class file version 53.0)ERROR
- How to Solve ERROR: Java 1.7 or later is required to run Apache Drill
- How to Solve Hbase JAVA import Package Error
- I/O error while reading input message; nested exception is java.io.IOException: Stream closed
- How to Solve IntelliJ IDEA Error: Cannot determine path to ‘tools.jar‘ library for 17 (C:\Program Files\Java\jd…
- [Solved] ClientAbortException: java.io.IOException: Connection reset by peer
- Springboot integrates Redis annotation and access error: java.io.NotSerializableException: com.demo.entity.MemberEntity
- How to Solve JAVA Error: error: A JNI error has occureed
- JAVA 8: How to Convert List to Map
- How to convert a Java string into a number (stringtonumber)
- How to Close the Current Form in JAVA Swing
- How to Solve Flick operate Error: not serialized
- [Solved] Sqoop Error: ERROR tool.ImportTool: Import failed: java.io.IOException