Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BEE33944A for ; Tue, 1 Nov 2011 02:14:01 +0000 (UTC) Received: (qmail 88485 invoked by uid 500); 1 Nov 2011 02:13:58 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 88299 invoked by uid 500); 1 Nov 2011 02:13:58 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 88290 invoked by uid 99); 1 Nov 2011 02:13:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Nov 2011 02:13:58 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of icicimov@gmail.com designates 209.85.210.173 as permitted sender) Received: from [209.85.210.173] (HELO mail-iy0-f173.google.com) (209.85.210.173) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Nov 2011 02:13:53 +0000 Received: by iaqq3 with SMTP id q3so3298519iaq.18 for ; Mon, 31 Oct 2011 19:13:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=f5LO87KO6Vl+PkLnpRMTJNVuoURBeQtM1xH8uYBQmTU=; b=QwlR3FRwfulm8TvJWInCc9ugZKn0IJ2FFEb33f91MT4jmWWyhb9HeC2T7Dl4bpWp+p O/1IHBmgg9hXOPR+yIYuNm4df9sGZMhu/myHBgHGwCo8h9ZORA6cHzllYKp5Y3F88q7D OnhA9dEyaLh7qSJuBum4pQOb+9VmYdRW2q0Fo= MIME-Version: 1.0 Received: by 10.231.51.4 with SMTP id b4mr5949175ibg.99.1320113613128; Mon, 31 Oct 2011 19:13:33 -0700 (PDT) Received: by 10.231.23.137 with HTTP; Mon, 31 Oct 2011 19:13:33 -0700 (PDT) In-Reply-To: <76A7159F4F167A4680050E6A2B1DB0C1098994B6@SG1RD3XVS451.red003.local> References: <76A7159F4F167A4680050E6A2B1DB0C10989907B@SG1RD3XVS451.red003.local> <3451529724817954742@unknownmsgid> <76A7159F4F167A4680050E6A2B1DB0C109899134@SG1RD3XVS451.red003.local> <4EA91BB0.9060707@kippdata.de> <76A7159F4F167A4680050E6A2B1DB0C109899173@SG1RD3XVS451.red003.local> <4EA97B09.5040407@christopherschultz.net> <4EAA9B1B.2040605@ice-sa.com> <76A7159F4F167A4680050E6A2B1DB0C1098994B0@SG1RD3XVS451.red003.local> <76A7159F4F167A4680050E6A2B1DB0C1098994B2@SG1RD3XVS451.red003.local> <76A7159F4F167A4680050E6A2B1DB0C1098994B6@SG1RD3XVS451.red003.local> Date: Tue, 1 Nov 2011 13:13:33 +1100 Message-ID: Subject: Re: cannot read complete HTTP request body. It reads only 8192 characters From: Igor Cicimov To: Tomcat Users List Content-Type: multipart/alternative; boundary=001517740ae0f943ac04b0a2e6de --001517740ae0f943ac04b0a2e6de Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Have you done the test in your environment simulating the customer one as close as possible? Maybe taking in count their network topology (routers, switches, firewalls), hundreds (possible thousands) of requests per second, network latency, tcp timeout kernel settings, buffer queue etc etc, the code will fail on your server too. For start lets say you might check their /etc/sysctl.conf file and see if their any tcp time settings differences from your server. On Tue, Nov 1, 2011 at 12:58 PM, Anantaneni Harish < anantaneni.harish@vertexsoft.com> wrote: > Dont know :(, must be different. > > Thanks and Regards, > Harish > > -----Original Message----- > From: Igor Cicimov [mailto:icicimov@gmail.com] > Sent: Tuesday, November 01, 2011 10:57 AM > To: Tomcat Users List > Subject: RE: cannot read complete HTTP request body. It reads only 8192 > characters > > And same kernel network settings? > On Nov 1, 2011 12:50 PM, "Anantaneni Harish" < > anantaneni.harish@vertexsoft.com> wrote: > > > Both environments have the following softwares. > > > > OS Name Red Hat Enterprise Linux > > Version release 5.3 (Tikanga) > > Java Name Java(TM) SE Runtime Environment (build 1.6.0_13-b03) > > Version 1.6.0_13 > > Tomcat Name apache-tomcat > > Version 5.5.28 > > > > Thanks and Regards, > > Harish > > -----Original Message----- > > From: Igor Cicimov [mailto:icicimov@gmail.com] > > Sent: Tuesday, November 01, 2011 10:47 AM > > To: Tomcat Users List > > Subject: Re: cannot read complete HTTP request body. It reads only 8192 > > characters > > > > You never said what is the difference between your environment and the > > customer one or I missed that info. Same OS? Same Java version? > > > > On Tue, Nov 1, 2011 at 12:42 PM, Anantaneni Harish < > > anantaneni.harish@vertexsoft.com> wrote: > > > > > > > > Any thoughts about this? > > > > > > Thanks and Regards, > > > Harish > > > -----Original Message----- > > > From: Anantaneni Harish > > > Sent: Monday, October 31, 2011 11:23 AM > > > To: Tomcat Users List > > > Subject: RE: cannot read complete HTTP request body. It reads only 81= 92 > > > characters > > > > > > String keyValuePair =3D null; > > > String[] arrKeyValue =3D null; > > > BufferedReader in =3D request.getReader(); > > > while ((keyValuePair =3D in.readLine()) !=3D null) { > > > arrKeyValue =3D keyValuePair.split("=3D"); > > > > > > Above code reads incomplete data(read only 8192 bytes) at my customer= 's > > > environment, but reads complete data in my environment. > > > > > > String keyValuePair =3D null; > > > String[] arrKeyValue =3D null; > > > BufferedReader in =3D new BufferedReader(new > > > InputStreamReader(request.getInputStream())); > > > while ((keyValuePair =3D in.readLine()) !=3D null) { > > > arrKeyValue =3D keyValuePair.split("=3D"); > > > > > > Above code reads complete data in both the environments. *no changes > done > > > to customer's environment. > > > > > > I hope you can help me now by finding the reason for data lost at my > > > customer's environment when using request.getReader(). > > > > > > Thanks and Regards, > > > Harish > > > > > > -----Original Message----- > > > From: Andr=E9 Warnier [mailto:aw@ice-sa.com] > > > Sent: Friday, October 28, 2011 9:08 PM > > > To: Tomcat Users List > > > Subject: Re: cannot read complete HTTP request body. It reads only 81= 92 > > > characters > > > > > > Konstantin Kolinko wrote: > > > > 2011/10/27 Christopher Schultz : > > > >> On 10/27/2011 4:58 AM, Anantaneni Harish wrote: > > > >>> Thanks for the directions the Rainer. Actually the issue is just > > > >>> solved. > > > >>> > > > >>> We have changed from BufferedReader in =3D request.getReader(); > > > >>> > > > >>> to > > > >>> > > > >>> BufferedReader in =3D new BufferedReader(new > > > >>> InputStreamReader(request.getInputStream())); > > > >>> > > > >>> Now whole body has been read at my client's environment as well. > > > >>> > > > >>> But would like to know, what causes the issue. Do you have any > > > >>> idea, why same method can read whole data in my environment and > > > >>> does not read whole data at my customer's environment? > > > >> You'll have to provide more information, such as the code you are > > > >> using. > > > >> > > > >> I'm fairly sure Tomcat is not the source of the problem. > > > >> > > > > > > > > +1. > > > > > > > > I think you need to pay more attention on the documentation of the > > > > java.io.Reader#read() method, or maybe look for a tutorial. > > > > > > > > See also documentation for java.io.InputStream#available(). > > > > > > > > In short: the read() method returns a portion of data that is > > > > currently available. If you need more data you must call read() > > > > repeatedly in a loop until it returns -1. > > > > > > > > > > .. and the difference between two systems, may be that on one system, > the > > > network is > > > faster (or the system slower, or the buffer bigger) and so by the tim= e > > you > > > do the read, > > > there are more bytes available in the buffer. > > > > > > > If you had provided some of your source code that performs reading, > we > > > > would be able to point at the exact error in your code. > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > > > For additional commands, e-mail: users-help@tomcat.apache.org > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > > > For additional commands, e-mail: users-help@tomcat.apache.org > > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > > For additional commands, e-mail: users-help@tomcat.apache.org > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > --001517740ae0f943ac04b0a2e6de--