Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 66541 invoked from network); 3 Feb 2010 06:26:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Feb 2010 06:26:17 -0000 Received: (qmail 33416 invoked by uid 500); 3 Feb 2010 06:26:16 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 33273 invoked by uid 500); 3 Feb 2010 06:26:15 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 33262 invoked by uid 99); 3 Feb 2010 06:26:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Feb 2010 06:26:15 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Feb 2010 06:26:14 +0000 Received: by brutus.apache.org (Postfix, from userid 33) id 9368E29A0019; Tue, 2 Feb 2010 22:25:54 -0800 (PST) From: bugzilla@apache.org To: dev@tomcat.apache.org Subject: DO NOT REPLY [Bug 47655] NullPointerException in MimeHeaders X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Tomcat 6 X-Bugzilla-Component: Catalina X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: knst.kolinko@gmail.com X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dev@tomcat.apache.org X-Bugzilla-Target-Milestone: default X-Bugzilla-Changed-Fields: In-Reply-To: References: X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Message-Id: <20100203062554.9368E29A0019@brutus.apache.org> Date: Tue, 2 Feb 2010 22:25:54 -0800 (PST) https://issues.apache.org/bugzilla/show_bug.cgi?id=47655 --- Comment #9 from Konstantin Kolinko 2010-02-02 22:25:48 UTC --- Looking at all the three stack traces (from the Description and Comment 1, Comment 2), all of them occur only if in MimeHeaders class methods headers[i] occurs to be null. That is particularly visible from the third stack trace, that points to org.apache.tomcat.util.http.MimeHeaders.clear(MimeHeaders.java:130) MimeHeaders.headers[i] equal to null can be only if MimeHeaders.count has a wrong value, or if a new MimeHeaderField was assigned to a wrong cell in the array, or to a wrong array when the array was expanded. That can only occur if MimeHeaders.createHeader() or MimeHeaders.removeHeader(int) were called concurrently by multiple threads. MimeHeaders class is not safe for multithreading. Therefore response.setHeader(...), response.addHeader(...) methods are not thread-safe. Thus, if several threads add/set headers asynchronously, you will see this error. This behavior conforms to the specification - see chapter SRV.2.3.3.3 in Java Servlet Specification 2.5. It says "Implementations of the request and response objects are not guaranteed to be thread safe." -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org