Hi all,

I have a tricky problem with a simple object serialization. It works fine on the desktop but produces a NotSerializableException when I run it on the 9210. A file is actually created but the exception occurs while the Vector is being serialized. I have also run the code on the desktop using JDK1.1.8 and it runs perfectly.

The class I want to serialize is:

// Class to hold a row in the Predials result table
public class Predials implements Serializable {
String dayFrom;
String dayTo;
String distance;
String countryCode;
String timeFrom;
String timeTo;
String predial;

public Predials() {
dayFrom = "";
dayTo = "";
distance = "";
countryCode = "";
timeFrom = "";
timeTo = "";
predial = "";
}

// clone the object
public Predials(Predials dial) {
dayFrom = dial.dayFrom;
dayTo = dial.dayTo;
distance = dial.distance;
countryCode = dial.countryCode;
timeFrom = dial.timeFrom;
timeTo = dial.timeTo;
predial = dial.predial;

}

// this is to check whether the script provided fully qualified rows (plus the predial read)
// before storing it
boolean fullyDefined () {
if (dayFrom != "" && dayTo != "" && distance != "" && countryCode != "" && timeFrom != "" && predial != "&quot
return true;
else
return false;
}
}

The code to serialize is:

public void storeObject(String path, Object obj) {
try {
FileOutputStream o = new FileOutputStream(path);
ObjectOutputStream oo = new ObjectOutputStream( o );
oo.writeObject(obj);
oo.flush();
oo.close();
}
catch( IOException e ) {
System.err.println( "Error storing object: &quot ;
e.printStackTrace();
System.exit( 0 );
}
}

Does anyone have any ideas ?

Thanks
Stefan