[jdom-interest] Serialization issue
mtminner at earthlink.net
mtminner at earthlink.net
Thu Oct 23 22:22:39 PDT 2003
Hello -
I am having a Serialization issue. I am using beta 9. When I try to send a list of Elements retrieved by calling root.getChildren(String) over RMI, I get the following java.rmi.RemoteException:
error unmarshalling return; nested exception is:
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.jdom.ContentList$FilterList
I noticed in the TODO.txt that in March of 2002 there was this problem:
http://lists.denveronline.net/lists/jdom-interest/2002-March/009857.html
which generated this response:
http://lists.denveronline.net/lists/jdom-interest/2002-March/009742.html
Having gone through the archives from March 2002 to October 2003, I can find no further mention of this (I did not read all the posts, just the subject lines - so the answer may be there). Can anybody help me with this? Is my problem different than the prior one? When I throw a println statement in just before the return, I verify that I do indeed have the correct Elements in the List. Here is the code I am using:
public List getRecords(String elementName, String recordType) throws RemoteException {
List records = new ArrayList();
String fileName = recordType + ".xml";
File file = new File(fileName);
if (file.exists()) {
try {
SAXBuilder builder = new SAXBuilder();
Document doc = builder.build(new java.io.File(fileName));
Element root = doc.getRootElement();
records = root.getChildren(elementName);
}
catch (JDOMException je) {
records = new ArrayList();
String success = "ERROR: JDOMException\nCould not retrieve records\n";
records.add(success);
}
catch (IOException ie) {
records = new ArrayList();
String success = "ERROR: IOException\nCould not retrieve records\n";
records.add(success);
}
}
System.out.println("Hi " + records);
return records;
}
More information about the jdom-interest
mailing list