JDK-6444131 : NPE in light weight httpserver code
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2006-06-27
  • Updated: 2017-07-20
  • Resolved: 2017-07-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6-poolResolved
Related Reports
Duplicate :  
Description
I see NPE in httpserver code of tiger's http.jar

     [java] FINER: ServerImpl.Exchange (2)
     [java] java.lang.NullPointerException
     [java]     at sun.net.httpserver.Request.<init>(Request.java:38)
     [java]     at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:436)
     [java]     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
     [java]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
     [java]     at java.lang.Thread.run(Thread.java:595)
     [java] Jun 27, 2006 12:10:20 PM sun.net.httpserver.HttpConnection close

Comments
Was fixed as a side effect of JDK-6756771. Closing as a duplicate.
20-07-2017

EVALUATION We can live with this for mustang FCS. Will fix in an update afterwards.
02-08-2006

EVALUATION This is as a result of the fix for 6433018. When creating the Request object all blank lines are skipped: do { startLine = readLine(); /* skip blank lines */ } while (startLine.equals ("")); but readLine may return null if the inputStream has reached EOF. This may happen due to a bad/partial request with an incomplete request line, e.g. "GET test/item HTT". The http server implementation, ServerImpl, can handle if this startLine is null (it will simply close the connection), so simply changing around the equals will fix the problem: do { startLine = readLine(); /* skip blank lines */ } while ("".equals (startLine));
28-06-2006