tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chun, Byung (GEAE, Elano)" <byung.c...@ae.ge.com>
Subject RE: InputStream read causing problems
Date Wed, 28 Jun 2000 16:14:00 GMT
There was a good article in the November 99 issue of Java Pro,
I don't have access to the site( requires club membership/monthly fee ),
but I think your problem stems from the PipedInputStreams internal buffer
limit( 1024 bytes ).  A thread writing to the stream will block if the
buffer is full. If you have only one thread reading and writing to the
same PipedInput Stream, it will block. Also, an IOException will be
thrown if you attempt to read from an empty buffer and the last thread
to write to the stream is no longer active ( same if you try to write
to a stream and the last thread to read from it is dead ).

The code listing had a solution to wrap the PipedOutputStream with a
ByteArrayOutputStream.  

Hope this helps
 
Jin

byung.chun@ae.ge.com

Elano Corporation

SCJP SCJA
OCP Oracle8 DBA
MCP


-----Original Message-----
From: Adam Paeth [mailto:apaeth@fortdearborn.com]
Sent: Wednesday, June 28, 2000 11:30 AM
To: Tomcat User List
Subject: InputStream read causing problems


I've run across an interesting problem...

I'm spawning an external process by getting a RunTime object and executing a
program.  The program runs fine.  However, I'm using an input stream to try
and get the output from the external program and I get a Broken Pipe error
in the tomcat.log.  I've even tried to just get the return code from the
external program. When the JSP page runs, there is no content to the web
page, not even the content before the scriplet that runs the eternal
program.

Has anyone else had this problem or been successful in running an external
program and getting the output and/or return code?

Adam Paeth / apaeth@fortdearborn.com
Advanced Technology Group
Fort Dearborn Company
1530 Morse Ave.
Elk Grove Village, IL 60007
847-427-5494 voice
847-357-8726 fax


--------------------------------------------------------------------------
To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
For additional commmands, email: tomcat-user-help@jakarta.apache.org

Mime
View raw message