Hey,
Ich habe ein Problem mit der API Kryonet. Ich habe mir eine Klasse gemacht in der ich eine Datei speicher(Siehe Code).
[CODE lang="java" title="FileM"]
package application;
import java.io.File;
public class FileM {
File file;
public FileM() {}
public FileM(File file) {
this.file = file;
}
public File getFile() {
return file;
}
public void setFile(File file) {
this.file = file;
}
}[/CODE]
[CODE lang="java" title="Fehlercode:"]com.esotericsoftware.kryonet.KryoNetException: Error during deserialization.
at com.esotericsoftware.kryonet.TcpConnection.readObject(TcpConnection.java:141)
at com.esotericsoftware.kryonet.Server.update(Server.java:205)
at com.esotericsoftware.kryonet.Server.run(Server.java:372)
at java.lang.Thread.run(Unknown Source)
Caused by: com.esotericsoftware.kryo.KryoException: Class cannot be created (missing no-arg constructor): java.io.File
Serialization trace:
file (application.FileM)
at com.esotericsoftware.kryo.Kryo$DefaultInstantiatorStrategy.newInstantiatorOf(Kryo.java:1228)
at com.esotericsoftware.kryo.Kryo.newInstantiator(Kryo.java:1049)
at com.esotericsoftware.kryo.Kryo.newInstance(Kryo.java:1058)
at com.esotericsoftware.kryo.serializers.FieldSerializer.create(FieldSerializer.java:547)
at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:523)
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:682)
at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:106)
at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:528)
at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:764)
at com.esotericsoftware.kryonet.KryoSerialization.read(KryoSerialization.java:55)
at com.esotericsoftware.kryonet.TcpConnection.readObject(TcpConnection.java:139)
... 3 more[/CODE]
Registriert habe ich alles.
Danke im Vorhinein.
Liebe Grüße.
Ich habe ein Problem mit der API Kryonet. Ich habe mir eine Klasse gemacht in der ich eine Datei speicher(Siehe Code).
[CODE lang="java" title="FileM"]
package application;
import java.io.File;
public class FileM {
File file;
public FileM() {}
public FileM(File file) {
this.file = file;
}
public File getFile() {
return file;
}
public void setFile(File file) {
this.file = file;
}
}[/CODE]
[CODE lang="java" title="Fehlercode:"]com.esotericsoftware.kryonet.KryoNetException: Error during deserialization.
at com.esotericsoftware.kryonet.TcpConnection.readObject(TcpConnection.java:141)
at com.esotericsoftware.kryonet.Server.update(Server.java:205)
at com.esotericsoftware.kryonet.Server.run(Server.java:372)
at java.lang.Thread.run(Unknown Source)
Caused by: com.esotericsoftware.kryo.KryoException: Class cannot be created (missing no-arg constructor): java.io.File
Serialization trace:
file (application.FileM)
at com.esotericsoftware.kryo.Kryo$DefaultInstantiatorStrategy.newInstantiatorOf(Kryo.java:1228)
at com.esotericsoftware.kryo.Kryo.newInstantiator(Kryo.java:1049)
at com.esotericsoftware.kryo.Kryo.newInstance(Kryo.java:1058)
at com.esotericsoftware.kryo.serializers.FieldSerializer.create(FieldSerializer.java:547)
at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:523)
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:682)
at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:106)
at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:528)
at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:764)
at com.esotericsoftware.kryonet.KryoSerialization.read(KryoSerialization.java:55)
at com.esotericsoftware.kryonet.TcpConnection.readObject(TcpConnection.java:139)
... 3 more[/CODE]
Registriert habe ich alles.
Danke im Vorhinein.
Liebe Grüße.