You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ritwick Dhar <ri...@EASTPOINT.COM> on 2000/11/24 17:35:15 UTC

HANDLER THREAD PROBLEM: Stream closed prematurely

Hi,

This problem is driving me nuts. I've tried debugging this, but nothing yet.
I was hoping someone on this list will have come accross this before.

Case: I have a servlet (server) that accepts POST requests (content-type=
application/x-ofx), and sends back a OFX response. I have another servlet
(client), that opens a URL to the server, writes the request, and reads the
reponse. Simple.

The problem is, the moment the client tries to call
'urlConn.getInputStream()' to get an inputstream from the server, I get this
(on the server console):

HANDLER THREAD PROBLEM: java.io.IOException: Stream closed prematurely
java.io.IOException: Stream closed prematurely
        at java.lang.Throwable.<init>(Compiled Code)
        at java.lang.Exception.<init>(Compiled Code)
        at java.io.IOException.<init>(Compiled Code)
        at
org.apache.tomcat.service.connector.AJP12RequestAdapter.readNextRequest(Comp
iled Code)
        at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
(Compiled Code)
        at org.apache.tomcat.service.TcpConnectionThread.run(Compiled Code)
        at java.lang.Thread.run(Compiled Code)

What's really driving me up the wall is that this works perfectly fine with
Both WebSphere and JRun. Is this something particular to Tomcat??

Thanks for all help

Rit

Re: HANDLER THREAD PROBLEM: Stream closed prematurely

Posted by William Brogden <wb...@bga.com>.
 Does your client close the stream that writes the request or
just flush it? I seem to recall having a problem similar to this
where the solution was to not close the client's output stream
until after the complete transaction.

Ritwick Dhar wrote:
> 
> Hi,
> 
> This problem is driving me nuts. I've tried debugging this, but nothing yet.
> I was hoping someone on this list will have come accross this before.
> 
> Case: I have a servlet (server) that accepts POST requests (content-type=
> application/x-ofx), and sends back a OFX response. I have another servlet
> (client), that opens a URL to the server, writes the request, and reads the
> reponse. Simple.
> 
> The problem is, the moment the client tries to call
> 'urlConn.getInputStream()' to get an inputstream from the server, I get this
> (on the server console):
> 
> HANDLER THREAD PROBLEM: java.io.IOException: Stream closed prematurely
> java.io.IOException: Stream closed prematurely
>         at java.lang.Throwable.<init>(Compiled Code)
>         at java.lang.Exception.<init>(Compiled Code)
>         at java.io.IOException.<init>(Compiled Code)
>         at
> org.apache.tomcat.service.connector.AJP12RequestAdapter.readNextRequest(Comp
> iled Code)
>         at
> org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
> (Compiled Code)
>         at org.apache.tomcat.service.TcpConnectionThread.run(Compiled Code)
>         at java.lang.Thread.run(Compiled Code)
> 
> What's really driving me up the wall is that this works perfectly fine with
> Both WebSphere and JRun. Is this something particular to Tomcat??
> 
> Thanks for all help
> 
> Rit

-- 
WBB - wbrogden@bga.com
Author of Java Developer's Guide to Servlets and JSP 
ISBN 0-7821-2809-2

Re: HANDLER THREAD PROBLEM: Stream closed prematurely

Posted by Kurt Bernhard Pruenner <le...@gmx.at>.
Ritwick Dhar wrote:
> HANDLER THREAD PROBLEM: java.io.IOException: Stream closed prematurely
> java.io.IOException: Stream closed prematurely
>         at java.lang.Throwable.<init>(Compiled Code)
>         at java.lang.Exception.<init>(Compiled Code)
>         at java.io.IOException.<init>(Compiled Code)
>         at
> org.apache.tomcat.service.connector.AJP12RequestAdapter.readNextRequest(Comp
> iled Code)

Could it be that you want to connect via port 8007 (which is for connections
using the AJP12 protocol) when you really want to be using port 8080 (which is
the port to use for normal HTTP requests)?

-- 
Kurt Bernhard Pruenner --- Haendelstrasse 17 --- 4020 Linz --- Austria
Music: http://www.mp3.com/Leak --- Work: http://www.ssw.uni-linz.ac.at
.......It might be written "Mindfuck", but it's spelt "L-A-I-N".......
np: Senor Coconut - Showroom Dummies (El Baile Aleman)