[jdom-interest] SAXBuilder hang when using InputStream

Uli Waibel uwaibel at t-online.de
Wed Feb 27 08:54:15 PST 2002


Hi,

i try to build a document with SAXBuilder.build(java.io.InputStream); The
Inputstrem object is from a socket object.
My client create a document and send it with XMLOutputter to a server.

<<< Client >>>
XMLOutputter printer = new XMLOutputter();
BufferedOutputStream out = new BufferedOutputStream(
tester.getOutputStream() ); // tester is a socket object
printer.output(doc,out);
out.flush();

<<< Server >>>
SAXBuilder builder = new SAXBuilder(false);
Document doc = builder.build(in);  <<-- it never comes back from
builder.build().
XMLOutputter printer = new org.jdom.output.XMLOutputter();
try
{
    printer.output(data,System.out);
}
catch( java.io.IOException e ){e.printStackTrace();}

If the client closes the socket, I receive a the exception
org.jdom.JDOMException: Error in building: socket closed (code=0)

Sending the data (XMLOutputter.putput(doc,out) is working, I checked these
with a simple socket read on server side.

I tried these with JDOM 1.0Beta7 and with the latest version from CVS, same
error.

Has anybody an idear whats going wrong ?

Thanks,

Uli Waibel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Ulrich Waibel.vcf
Type: text/x-vcard
Size: 519 bytes
Desc: not available
Url : http://jdom.org/pipermail/jdom-interest/attachments/20020227/0dbaad38/UlrichWaibel.vcf


More information about the jdom-interest mailing list