tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 47655] NullPointerException in MimeHeaders
Date Wed, 03 Feb 2010 06:25:54 GMT

--- 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 

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

This behavior conforms to the specification - see chapter SRV. in Java
Servlet Specification 2.5.  It says "Implementations of the request and
response objects are not guaranteed to be thread safe."

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message