https://issues.apache.org/bugzilla/show_bug.cgi?id=47451
Summary: NPE if response contains null content-encoding header Product: Tomcat 6 Version: 6.0.20 Platform: PC OS/Version: Windows XP Status: NEW Severity: normal Priority: P2 Component: Connectors AssignedTo: dev@tomcat.apache.org ReportedBy: dan.r...@oracle.com I've been getting a NullPointerException when using the JnlpDownloadServlet from JDK 1.6.0_14 with Tomcat 6.0.20: Jun 29, 2009 3:35:03 PM org.apache.coyote.http11.Http11Processor process SEVERE: Error finishing response java.lang.NullPointerException at org.apache.tomcat.util.buf.MessageBytes.indexOf(MessageBytes.java:479) at org.apache.tomcat.util.buf.MessageBytes.indexOf(MessageBytes.java:485) at org.apache.coyote.http11.Http11Processor.isCompressable(Http11Processor.java:1441) at org.apache.coyote.http11.Http11Processor.prepareResponse(Http11Processor.java:1517) at org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:944) at org.apache.coyote.Response.action(Response.java:181) at org.apache.coyote.http11.InternalOutputBuffer.endRequest(InternalOutputBuffer.java:379) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:889) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454) at java.lang.Thread.run(Thread.java:619) A brief analysis of the JnlpDownloadServlet code shows that the content-encoding header on the response is being set to null in DownloadResponse$FileDownloadResponse. The Tomcat code tries to guard against a null header in Http11Process.isCompressable: if ((contentEncodingMB != null) && (contentEncodingMB.indexOf("gzip") != -1)) return false; However, it appears that it's possible for contentEncodingMB, which is an instance of MessageBytes, to be non-null, while the value encapsulated by the MessageBytes IS null, resulting in an NPE in MessageBytes.indexOf(). Since this occurs with the JnlpDownloadServlet provided by Sun (see http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/downloadservletguide.html), I imagine more people might be running into this problem. -- 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org