tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rossen Raykov <Rossen.Ray...@CognicaseUSA.com>
Subject RE: request.getReader() hanging
Date Wed, 05 Jun 2002 16:01:11 GMT
The problem is that apj13 does not serve servlets and JSP pages correct
also.
It hangs making useless communications with mod_jk and uses all the
available CPU power.
If I kill the corresponding http daemon the following error appears in the
log:

Ajp13Processor[25181][0] process: invoke
java.io.IOException: Broken pipe
        at java.net.SocketOutputStream.socketWrite(Native Method)
        at java.net.SocketOutputStream.write(SocketOutputStream.java:83)
        at org.apache.ajp.Ajp13.send(Ajp13.java:525)
        at org.apache.ajp.RequestHandler.finish(RequestHandler.java:496)
        at org.apache.ajp.Ajp13.finish(Ajp13.java:395)
        at
org.apache.ajp.tomcat4.Ajp13Response.finishResponse(Ajp13Response.java:192)
        at
org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:435)
        at
org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:495)
        at java.lang.Thread.run(Thread.java:484)

That makes me think that the request header processing is braking if
specific data is send
(in jakarta-tomcat-connectors-4.0.2-01-src\jk\doc\AJPv13.html there is
interesting question at the bottom of the document and it may be the key for
this problem).
Most probably you have the same problem.
I'm about to debug it but unfortunately I can not reproduce it on my system.

Is the problem that you are talking about related to any specific data?
Shall the data in the quoted example be sufficient to hang the Connector?
BW what OS you are using?

Regards,
Rossen

> -----Original Message-----
> From: chris.karema@omiris.net [mailto:chris.karema@omiris.net]
> Sent: Wednesday, June 05, 2002 6:31 AM
> To: tomcat-user@jakarta.apache.org
> Subject: RE: request.getReader() hanging
> 
> 
> i think i've narrowed the problem down to the ajp13 connector, what's
> strange is the connector works fine for all other  /servlet and *.jsp
> requests, apart from those where you try to read the request 
> data using
> request.getReader()
> moreover, performing the same task but making the request 
> directly to tomcat
> produces no problems
> Code snippets follow:
> 4660 = apache port
> 4661 = tomcat port
> ==============================================================
> ==============
> =
> Request Page (sample.html)
> <html>
> <head>
> <script language="javascript">
>    function doXml(){
> 	// Create a requestor and post the request...
> 	var xmlRequestor = new	ActiveXObject("Microsoft.XMLHTTP");
> 	xmlRequestor.Open("POST",
> "http://localhost:4660/servlet/SampleServlet", false);
> 	xmlRequestor.SetRequestHeader("Content-type",
> "application/x-www-form-urlencoded");
> 	xmlRequestor.Send("<parent><child>some data</child></parentt>");
> 
> 	alert(xmlRequestor.responseText);
>    }
> </script>
> </head>
> <body bgcolor="#FFFFFF" text="#000000">
> 	<script>
> 		doXml();
> 	</script>
> </body>
> </html>
> ==============================================================
> ==============
> ===================================
> Sample Servlet
> 
> public void doPost(HttpServletRequest request,HttpServletResponse
> response)throws ServletException,IOException{
> 	BufferedReader br = request.getReader();
> 	String line = null;
> 	StringBuffer envelope = new StringBuffer();
> 	while ((line = br.readLine()) != null) {
> 		envelope.append(line);
> 	}
> 	br.close();
> 	
> 	PrintWriter out=response.getWriter();
> 	out.println(envelope+"<returned/>");
> }
> ==============================================================
> ==============
> ===================================
> 
> If you substitute 4661(tomcat standalone port) for 
> 4660(apache port) in the
> request url in the html page, it works fine.
> 
> cheers
> Chris
> 
> 
> 
> 
> -----Original Message-----
> From: Rossen Raykov [mailto:Rossen.Raykov@CognicaseUSA.com]
> Sent: 03 June 2002 18:08
> To: 'Tomcat Users List'
> Subject: RE: request.getReader() hanging
> 
> 
> Can you reproduce it?
> Does it utilize the whole available CPU?
> 
> Rossen
> 
> > -----Original Message-----
> > From: chris.karema@omiris.net [mailto:chris.karema@omiris.net]
> > Sent: Friday, May 31, 2002 1:21 PM
> > To: tomcat-user@jakarta.apache.org
> > Subject: request.getReader() hanging
> > 
> > 
> > hi all
> > recently upgraded, or attempted to upgrade, to tomcat 4.0.3, 
> > but have hit a
> > brick wall.i had a servlet with the following code snippet 
> > running perfectly
> > fine in 3.2.3 but it's not having any of it with tomcat 4.0.3
> > 
> >       BufferedReader br = request.getReader();
> >       String line = null;
> >       StringBuffer envelope = new StringBuffer();
> >       while ((line = br.readLine()) != null) {
> >         envelope.append(line);
> >       }
> >       br.close();
> > 
> > I'm basically sending through a stream of xml data and trying 
> > to read it in
> > the servlet's post method. What happens is when it gets to 
> > the readLine()
> > method above, it just hangs forever.
> > Trying to read just one character with a simple read() 
> > produces the same
> > behaviour.
> > I've checked the request.content-length and it indicates the 
> > data is there.
> > No exceptions are thrown or anything. I'm not reading any 
> > parameters from
> > the request object beforehand either.
> > 
> > Running Apache 1.3, Tomcat 4.0.3, Solaris 8, with mod_jk
> > 
> > I've read and adhered to the Servlet API Specification, 
> > version 2.2, section
> > 5.1, as a previous post about a similar problem suggested, 
> > but still no joy
> > 
> > please help
> > cheers
> > 
> > 
> > 
> **********************************************************************
> > This email and any files transmitted with it are confidential and
> > intended solely for the use of the individual or entity to whom they
> > are addressed. If you have received this email in error 
> please notify
> > postmaster@omiris.net.
> > 
> > This footnote also confirms that this email message has 
> been swept by
> > MIMEsweeper for the presence of computer viruses.
> > 
> **********************************************************************
> > 
> 
> --
> To unsubscribe, e-mail:
> <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:tomcat-user-help@jakarta.apache.org>
> 

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message