Witam. Szybkie pytanie:
Mam eclipse, tworze sobie projekt J2ME.
Mam tam dwa pliki, ponieważ nie ma serializacji, to sam ją implementuje i tak:
plik1:
/**
* @see pl.bgora.utils.Persistent#read(java.io.DataInputStream)
*/
public void read(DataInputStream in) throws IOException {
this.phone_id = new Integer(in.readInt());
this.server_id = new Integer(in.readInt());
this.note = in.readUTF();
this.person_id = new Integer(in.readInt());
this.person_server_id = new Integer(in.readInt());
}
/**
* @see pl.bgora.utils.Persistent#write(java.io.DataOutputStream)
*/
public void write(DataOutputStream out) throws IOException {
out.writeInt(this.phone_id!=null?this.phone_id.intValue():Constants.NO_VALUE);
out.write(this.server_id!=null?this.server_id.intValue():Constants.NO_VALUE);
out.writeUTF(this.note);
out.writeInt(this.person_id!=null?this.person_id.intValue():Constants.NO_VALUE);
out.write(this.person_server_id!=null?this.person_server_id.intValue():Constants.NO_VALUE);
}
plik2:
/**
* @see pl.bgora.utils.Persistent#read(java.io.DataInputStream)
*/
public void read(DataInputStream in) throws IOException {
this.person_id = new Integer(in.readInt());
this.server_id = new Integer(in.readInt());
this.name = in.readUTF();
this.surname = in.readUTF();
this.status = in.read();
}
/**
* @see pl.bgora.utils.Persistent#write(java.io.DataOutputStream)
*/
public void write(DataOutputStream out) throws IOException {
out.writeInt(this.person_id!=null?this.person_id.intValue():Constants.NO_VALUE);
out.write(this.server_id!=null?this.server_id.intValue():Constants.NO_VALUE);
out.writeUTF(this.name);
out.writeUTF(this.surname);
out.writeInt(this.status);
}
W pliku 2 pluje mi czymś takim:
Severity and Description Path Resource Location Creation Time Id
Error preverifying class pl.bgora.model.Person
VERIFIER ERROR pl/bgora/model/Person.read(Ljava/io/DataInputStream;)V:
Cannot find class java/io/FilterInputStream DatabaseMidlet/src/pl/bgora/model Person.java Unknown 1241470105906 1191
Dlaczego? I dlaczego nie pluje mi w pliku 1?
Ścieżki są ok. Sprawdzałem 10 razy.
Czy problemem może być to, że midp = jdk 1.3 a ja mam 1.6 ?
Pozdro.