Mantis - Resin
Viewing Issue Advanced Details
2583 major always 04-09-08 08:29 04-09-08 15:00
katjak  
ferg  
normal  
closed 3.0.25  
fixed  
none    
none 3.0.26  
0002583: NPE from AbstractHttpResponse.writeHeaders() when calling NamedDispatcherImp.include()
We get this with Resin 3.0.24 and 3.0.25, but not with 3.0.19 or other servlet containers:

java.lang.NullPointerException
    at com.caucho.server.connection.AbstractHttpResponse.writeHeaders(AbstractHttpResponse.java:1585)
    at com.caucho.server.connection.IncludeResponseStream.writeNext(IncludeResponseStream.java:244)
    at com.caucho.server.connection.ToByteResponseStream.flushByteBuffer(ToByteResponseStream.java:518)
    at com.caucho.server.connection.ToByteResponseStream.flushBuffer(ToByteResponseStream.java:424)
    at com.caucho.server.connection.IncludeResponseStream.finish(IncludeResponseStream.java:301)
    at com.caucho.server.connection.AbstractHttpResponse.finish(AbstractHttpResponse.java:1988)
    at com.caucho.server.connection.AbstractHttpResponse.finish(AbstractHttpResponse.java:1957)
    at com.caucho.server.webapp.NamedDispatcherImpl.include(NamedDispatcherImpl.java:85)
    at foo.bar.DispatchFilter.dispatch(DispatchFilter.java:138)

Looking at the code between different versions, it seems that AbstractHttpResponse.writeHeaders() has been rewritten, and either the _originalRequest attribute doesn't get set like it should when using include() instead of forward(), or there should be a null check for _originalRequest in writeHeaders method.

Notes
(0002953)
ferg   
04-09-08 15:00   
server/10ju