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;

 

遗失的拂晓
目录
打赏
0
0
0
0
41
分享
相关文章
Java The method compareTo(Integer) in the type解决方法
Java编程过程中,Integer对象(或其它继承自Number类的包装类对象)使用Number包装类内置的compareTo()方法来比较调用对象和参数之间的大小的时候,Java的集成开发环境IDE或编译器给出了提示:The method compareTo(Integer) in the type Integer is not applicable for the arguments (Float)
72 5
Unable to interpret the implicit parameter configuration with dataType: , dataTypeClass: class java.
Unable to interpret the implicit parameter configuration with dataType: , dataTypeClass: class java.
674 0
Java“class file contains wrong class”解决
当Java程序运行时出现“class file contains wrong class”错误,通常是因为类文件与预期的类名不匹配。解决方法包括:1. 确保类名和文件名一致;2. 清理并重新编译项目;3. 检查包声明是否正确。
102 3
解决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
1050 1
Description:Field contentMapper in worldtolingyidianke.file.service.impl.ContentServiceImpl requir
Description:Field contentMapper in worldtolingyidianke.file.service.impl.ContentServiceImpl requir
完美解决tomcat启动异常:Invalid byte tag in constant pool: 19;Unable to process Jar entry [module-info.class]
完美解决tomcat启动异常:Invalid byte tag in constant pool: 19;Unable to process Jar entry [module-info.class]
1504 0
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
222 0
Could not initialize English chunker/Could not load file from classpath: ‘/en-token.bin‘
Could not initialize English chunker/Could not load file from classpath: ‘/en-token.bin‘
128 0