Kyronet(由:com.esotericsoftware.kryo.KryoException: Class cannot be created (missing noarg constructor): Network.FileM引起)

2022-01-29 10:03:32 标签 java

Exeption:

com.esotericsoftware.kryonet.KryoNetException: Error during deserialization.
at com.esotericsoftware.kryonet.TcpConnection.readObject(TcpConnection.java:141)
at com.esotericsoftware.kryonet.Client.update(Client.java:255)
at com.esotericsoftware.kryonet.Client.run(Client.java:338)
at java.base/java.lang.Thread.run(Thread.java:832)

类不能被创建(缺少无参数的构造函数):Network。《

com。esotericsoftware。kryo。Kryo DefaultInstantiatorStrategy。newInstantiatorOf美元(Kryo。java: 1228)

com。esotericsoftware。kryo。Kryo。newInstantiator (Kryo。java: 1049)

com。esotericsoftware。kryo。Kryo。newInstance (Kryo。java: 1058)

com。esotericsoftware。kryo。serializers。FieldSerializer。create (FieldSerializer。java: 547)

com。esotericsoftware。kryo。serializers。FieldSerializer。read (FieldSerializer。java: 523)

com。esotericsoftware。kryo。Kryo。readClassAndObject (Kryo。java: 764)

com。esotericsoftware。kryonet。KryoSerialization。read (KryoSerialization。java: 55)

com。esotericsoftware。kryonet。TcpConnection。readObject (TcpConnection。java: 139)

.。. 三个

类:

package Network;

import java.io.File;

public class FileM {

私人文件文件;

public FileM(File file) {
    this.file = file;
    
}
public File getFile() {
    return file;
}
public void setFile(File file) {
    this.file = file;
}

}

阅读全文

▼ 版权说明

相关文章也很精彩
推荐内容
更多标签
相关热门
全站排行
随便看看

错说 cuoshuo.com —— 程序员的报错记录

部分内容根据CC版权协议转载;网站内容仅供参考,生产环境使用务必查阅官方文档

辽ICP备19011660号-5

×

扫码关注公众号:职场神器
发送: 1
获取永久解锁本站全部文章的验证码