local class incompatible: stream classdesc serialVersionUID = 4125096758372084309, local class serialVersionUID = 7725746634795906143

简介: local class incompatible: stream classdesc serialVersionUID = 4125096758372084309, local class serialVersionUID = 7725746634795906143 出现以上错误信息,一搬是启用...

local class incompatible: stream classdesc serialVersionUID = 4125096758372084309, local class serialVersionUID = 7725746634795906143

 

出现以上错误信息,一搬是启用了磁盘缓存,对象使用了序列化接口,而未给对象分配序列化id,当对象做出字段的改变时,就会出现版本兼容的问题,定义一个id可以有效的进行版本兼容

只需加上序列化id即可

    /**
     * 序列化id
     */
    private static final long serialVersionUID = 4125096758372084309L;

 

遗失的拂晓
目录
相关文章
|
1月前
|
Python
The Instance Class Static Magic Method in Python
So what is the difference between the Instance method, the Class method and the Static method?
27 8
|
10月前
|
Java 数据库连接 Apache
Correct the classpath of your application so that it contains compatible versions of the classes com
Correct the classpath of your application so that it contains compatible versions of the classes com
|
4月前
|
Java 编译器 Maven
Java“class file contains wrong class”解决
当Java程序运行时出现“class file contains wrong class”错误,通常是因为类文件与预期的类名不匹配。解决方法包括:1. 确保类名和文件名一致;2. 清理并重新编译项目;3. 检查包声明是否正确。
97 3
|
7月前
|
Java Android开发
解决Android编译报错:Unable to make field private final java.lang.String java.io.File.path accessible
解决Android编译报错:Unable to make field private final java.lang.String java.io.File.path accessible
1019 1
|
Java
Java Error: The public type HelloWorld must be defined in its own file
Java Error: The public type HelloWorld must be defined in its own file
215 0