Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362614 - NPE in accepting connection
Summary: NPE in accepting connection
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: 7.5.4   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 7.5.x   Edit
Assignee: Jan Bartel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 364033 364372 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-11-01 21:01 EDT by Jan Bartel CLA
Modified: 2011-11-21 18:49 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Bartel CLA 2011-11-01 21:01:11 EDT
Line 162 of SelectorManager can throw a NullPointerException iff:

* the Connectors are opened before Server.start() (eg in order to open as root before using setuid to change down to a lower privileged user)

* a request arrives before the SelectorManager has completed its its start() sequence. In this case, the SelectorSet[] array is allocated, but empty.
Comment 1 Jan Bartel CLA 2011-11-01 21:03:41 EDT
Resolved for 7.5.5.
Comment 2 Jan Bartel CLA 2011-11-17 22:15:30 EST
*** Bug 364033 has been marked as a duplicate of this bug. ***
Comment 3 Jan Bartel CLA 2011-11-21 18:47:35 EST
Just for completeness' sake, for those finding this issue, I got the line number wrong in the original comment. The problem actually occurs at line 158:

java.lang.NullPointerException
        at org.eclipse.jetty.io.nio.SelectorManager.register(SelectorManager.java:158)
        at org.eclipse.jetty.server.nio.SelectChannelConnector.accept(SelectChannelConnector.java:101)
        at org.eclipse.jetty.server.AbstractConnector$Acceptor.run(AbstractConnector.java:833)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
        at java.lang.Thread.run(Thread.java:680)
Comment 4 Jan Bartel CLA 2011-11-21 18:49:59 EST
*** Bug 364372 has been marked as a duplicate of this bug. ***