[jdom-interest] Problem
Etienne-Hugues Fortin
efortin at originalsim.com
Wed Mar 7 07:05:38 PST 2001
Hi,
Sorry if this message appears again in the future, I sent it with the wrong email account so it has been retain at the border (moderator)... Anyway, this one should go through directly...
I'm using jdom since early october and I'm experiencing some problems.
First, the context.
I have a servlet running on a master server. One of the features of this
servlet is to be able to send the content of a table in XML, task that seems
to work well.
I also have a process on a slave server that connect to the master once in a
while and ask about data for some tables. It seems to work well also but
for small table. One of the table contains 3442 records with this
definition:
ID int auto_increment NOT NULL,
Name char(80) DEFAULT '',
Description text DEFAULT '',
Creation_Date Datetime DEFAULT '',
SIZE int DEFAULT 0,
Keywords VARCHAR(255) DEFAULT '',
SubmitBy int DEFAULT 1,
Version CHAR(12) DEFAULT '',
DirectoryID int DEFAULT 0,
ProjectID int DEFAULT 1,
Status int DEFAULT 1,
Filetype VARCHAR(10) DEFAULT '',
CVSID int DEFAULT 0,
LastUpdated timestamp
As you can see, it's not a really heavy table. I estimate the whole data
under 500K. Here's an example of the data I receive:
<?xml version="1.0" encoding="UTF-8" ?>
<Table Name="Artifacts">
<Record Id="8787">
<ProjectID>31</ProjectID>
<SubmitBy>1</SubmitBy>
<Description />
<DirectoryID>1136</DirectoryID>
<Creation_Date>2001-02-15 17:15:40</Creation_Date>
<SIZE>0</SIZE>
<Name>MyFile.pdf</Name>
<Filetype>L</Filetype>
<Status>1</Status>
<Version />
<Keywords />
<CVSID>98</CVSID>
<LastUpdated>20010215171540</LastUpdated>
</Record>
...
</Table>
And here's the error (not always the same but always about incorrect
end-tag):
org.jdom.JDOMException: Error on line 2941: The element type "LastUpdated"
must be terminated by the matching end-tag "</LastUpdated>".
Finally, here's the code that I use on the client side:
--- begin ---
unet = Url.openConnection();
unet.setDoOutput(true);
unet.setRequestProperty("Cookie", cookie);
unet.setRequestProperty("content-type",
"application/x-www-form-urlencoded");
out = new DataOutputStream(unet.getOutputStream());
out.writeBytes(
"Act=getupdate&tablename=" + tableName);
out.flush();
out.close();
SAXBuilder jdom = new SAXBuilder();
Document doc = jdom.build(unet.getInputStream());
--- end ---
The exception is generated in the jdom.build. Based on that, there's big
change that either the master server don't always send everything (I doubt
on this because if I connect with a browser, I always get the full result
but it can take time) or the slave timed-out or lost the connection at some
point.
What would be the best thing to do in that situation? Is there something to
know about jdom.build(InputStream) concerning timeout? Is there a mechanism
already existing that would give me the capability to establish that a
problem occurs and that would retry in some way?
Somebody else tried to do something similar?
Thanks.
Etienne Fortin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20010307/83390567/attachment.htm
More information about the jdom-interest
mailing list