[jdom-interest] JDOM -> Xalan using PipedStreams

Karachiwala, Aslam Aslam.Karachiwala at tfn.com
Fri Aug 3 08:12:30 PDT 2001


Thanks, Jim. We did miss the deadlock issue and will incorporate the
recommendation in our code.

Yes, it *was* hanging on xformer.transform() and this was most likely
attributable to not closing the PipedOutputStream after it was written to.
Here's the posting that helped me fix this...
http://www.servlets.com/archive/servlet/ReadMsg?msgId=5822&listName=jdom-int
erest

--aslam

-----Original Message-----
From: newsham at hotu.com [mailto:newsham at hotu.com]
Sent: Thursday, August 02, 2001 2:56 PM
To: 'jdom-interest at jdom.org'
Subject: Re: [jdom-interest] JDOM -> Xalan using PipedStreams

Are you sure it is hanging on xformer.transform()?  If you are using piped
streams
in a single thread (as is done in Brett's tip), you may deadlock while
writing to
the PipedOutputStream.  According to the PipedOutputStream javadocs,
"Attempting to
use both objects from a single thread is not recommended as it may deadlock
the
thread."  I have had code based on Brett's tip deadlock on some input, and
succeed
on other input (probably based on file size).  I fixed this by spawning a
new thread
to write to the output stream and then quit.

Jim



_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com



More information about the jdom-interest mailing list