[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...


-----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
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
thread."  I have had code based on Brett's tip deadlock on some input, and
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.


To control your jdom-interest membership:

More information about the jdom-interest mailing list