Jetty
  1. Jetty
  2. JETTY-163

NPE from HttpChannelEndPoint.isOpen()

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.0.1
    • Fix Version/s: None
    • Component/s: NIO
    • Labels:
      None
    • Environment:
      Mac OS X 10.4.x
    • Number of attachments :
      0

      Description

      Under some conditions following exception gets thrown:

      java.lang.NullPointerException
      at org.mortbay.jetty.nio.HttpChannelEndPoint.isOpen(HttpChannelEndPoint.java:158)
      at org.mortbay.jetty.HttpConnection.handlerRequest(HttpConnection.java:457)
      at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:666)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:487)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:197)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:336)
      at org.mortbay.jetty.nio.HttpChannelEndPoint.run(HttpChannelEndPoint.java:270)
      at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)

      It looks like super.isOpen() returns true even though _key was assigned null (probably in close()).

      What's wrong with checking for _key to be not null as well as it's validity (and make it synchronized as well)?
      Something along this lines:

      public synchronized boolean isOpen()

      { return super.isOpen() && _key != null && _key.isValid(); }

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Greg Wilkins
            Reporter:
            andrei tchijov
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: