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 DD2F67350 for ; Wed, 14 Sep 2011 14:36:51 +0000 (UTC) Received: (qmail 24072 invoked by uid 500); 14 Sep 2011 14:36:47 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 24015 invoked by uid 500); 14 Sep 2011 14:36:47 -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 24006 invoked by uid 99); 14 Sep 2011 14:36:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Sep 2011 14:36:47 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of pid@pidster.com designates 74.125.82.43 as permitted sender) Received: from [74.125.82.43] (HELO mail-ww0-f43.google.com) (74.125.82.43) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Sep 2011 14:36:40 +0000 Received: by wwf27 with SMTP id 27so2302312wwf.0 for ; Wed, 14 Sep 2011 07:36:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pidster.com; s=google; h=message-id:date:from:organization:user-agent:mime-version:to :subject:references:in-reply-to:x-enigmail-version:openpgp :content-type; bh=bYYCG2QnQUHxemhnJbeeGuiChK1Oj7xoE+dwhuo4Z6I=; b=na8gNUa9/7Lh6Ux62q/k83w8HWDh+JIDOiLs8jbSBwx533qwCYF7itQ2tbNlrfmZAB wdzeE6oXOXbFoNbW0wzLZhuEGtL57zzWSTEUNPTEiVUHKzijShExQ9LJEjDYzCYI1B+y ywZfgVDm33hBOd1OfQh1/N9e1ALSXoITrrSBQ= Received: by 10.227.207.129 with SMTP id fy1mr530192wbb.22.1316010978688; Wed, 14 Sep 2011 07:36:18 -0700 (PDT) Received: from Asura.local (host81-130-5-85.in-addr.btopenworld.com. [81.130.5.85]) by mx.google.com with ESMTPS id fp5sm4306661wbb.2.2011.09.14.07.36.16 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Sep 2011 07:36:17 -0700 (PDT) Message-ID: <4E70BBDF.30909@pidster.com> Date: Wed, 14 Sep 2011 15:36:15 +0100 From: Pid Organization: Pidster Inc User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Request params randomly null in servlet(s) References: <32461421.post@talk.nabble.com> <4E706B44.7020600@pidster.com> <32462485.post@talk.nabble.com> In-Reply-To: <32462485.post@talk.nabble.com> X-Enigmail-Version: 1.3.1 OpenPGP: id=62590808 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enigD1C899637C944E60A79AD710" --------------enigD1C899637C944E60A79AD710 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 14/09/2011 11:55, Darius D. wrote: >=20 >=20 >=20 > Pid * wrote: >> >> doProcess(req, res) is not a Servlet API method. What other method(s) >> call it? >> >> Usually this type of thing occurs because the request (or response) is= >> being held as an instance field somewhere in a thread-unsafe way. >> >> >=20 > It is called from: > public void doGet(HttpServletRequest request, HttpServletResponse resp= onse) > throws ServletException, IOException { > doProcess(request, response); > } >=20 > and doPost(...) as well.=20 >=20 > I am not quite sure where and what could be holding the request, as thi= s > method is the called directly and request params are already NULL ? They are in *that* thread. It is possible to expose either request or response object outside of the scope of the thread, so a second request sees a modified version of the same object. E.g. public class SomeServlet extends HttpServlet { private HttpServletRequest request; protected void doGet(HttpServletRequest rq, HttpServletResponse rs) { // this is a handy value, let's store it (FAIL!) this.request =3D request; // do something... process(this.request); // finish... } } So a different thread entering the method causes the request object to be updated before the other thread has finished using it. There are other, more subtle, ways to cause the same effect. p --------------enigD1C899637C944E60A79AD710 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBCgAGBQJOcLvfAAoJEGoM2OGpOvr9/dMP/0M5pxFJoNibKjxoGdeNZgaF SFUNGINxBNqEgk4z5UFZrG8ggbbtwP3FcNHp+6VR2EfB0DjBtyKS3Fmnz4OmoKka G08FI08Dp8tdFsYssygX1fKpRB/t5BGH8Ku4Vl5ZKic+gUl2FZt5qAqlLzonNwWf kA+EURX94OQAW341QYNDQLH+9ZINqtngciw3lpk8kiHaKPRuno3jVlWrTdaXptcK o/lLm93devADrcltaOpX4wxGy9LIrno3t85iW2ZM2nGHhZkO0//rtW6U9uFEvnoH 5X70XiTJsnd5+rldpK+X3SLHqjm60SAxifkpduCa4dSbTEJXf+FYE/+16fYHN0+F wx7aq4ztsLXNsFStqc/x1d+HdNo1jhkqVf07qehrbWBILowK5+tFFk9FowX5PNcZ s8SdvSp+virsmZKMn87egRpNUIHlN84NX+gneEwbqnXaVzJxW0QjFNwr4vpLD5z6 g2RlnrKhYi5HifQDFOGqafTI1rgt7cBOO2peB9gVtqydbRkl4CkLrRHJMJqHMd1R 1TT/vw6Brp8xaUxHvhwLPKglF8ZP4U9ZupsC95mWPu/OWkZlwM/kN3Hv5lxDCGVn Mc/cQWJxkOqfPcnrP2rySnBW4ICYyXNj3MSG4RmHWWebMxvWLBoQy4GkZQ556Qew mBMmAqlYTOXhXU42aoUd =UHk0 -----END PGP SIGNATURE----- --------------enigD1C899637C944E60A79AD710--