tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 47655] NullPointerException in MimeHeaders
Date Wed, 03 Feb 2010 06:25:54 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=47655

--- Comment #9 from Konstantin Kolinko <knst.kolinko@gmail.com> 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


Mime
View raw message