Ich habe folgende Fehlermeldung:IOException - keine Ahnung warum?
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: flexitime.UniSystems
Was ist der üblicher Grund dafür? Ich versuche eine Datei in namens storage.dat zu lesen.
Der Code, in dem er den Fehler erhält, ist
private void loadFile() {
try {
FileInputStream inStream = new FileInputStream(fileName);
ObjectInputStream inputObjects = new ObjectInputStream(inStream);
system = (UniSystems)inputObjects.readObject();
inStream.close();
}
catch (ClassNotFoundException err) {
// Class in the file does not have a matching class definition
JOptionPane.showMessageDialog(null, "Please contact IT Support quoting code CNF",
"Application error!", JOptionPane.ERROR_MESSAGE);
err.printStackTrace();
}
catch (IOException err) {
// Some other IO error has occurred
JOptionPane.showMessageDialog(null, "Please contact IT Support quoting code IIO",
"Application error!", JOptionPane.ERROR_MESSAGE);
err.printStackTrace();
}
}
Es macht es bis zum 2. Fang durch und wirft dann den Fehler zurück. Irgendwelche Ideen?
Von der Ausnahme scheint es, dass "UniSystems" Serializable nicht implementiert. Sind Sie sicher, dass das Objekt, das Sie gerade lesen? –
Wo würde ich serialisieren müssen? Und die Datei liest sich ein und verwendet dann UniSystems, um das Auffüllen durchzuführen. – sark9012