Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 367500 - NPE during websocket handshake
Summary: NPE during websocket handshake
Status: CLOSED INVALID
Alias: None
Product: Jetty
Classification: RT
Component: websocket (show other bugs)
Version: 8.0.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 7.5.x   Edit
Assignee: Joakim Erdfelt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-23 10:39 EST by Joakim Erdfelt CLA
Modified: 2012-01-12 13:13 EST (History)
1 user (show)

See Also:


Attachments
Chrome websocket handshake testcase (4.23 KB, text/x-java)
2012-01-12 13:12 EST, Joakim Erdfelt CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joakim Erdfelt CLA 2011-12-23 10:39:17 EST
Bug reported in jetty-users mailing list.
http://dev.eclipse.org/mhonarc/lists/jetty-users/msg01793.html

java.lang.NullPointerException
	at org.eclipse.jetty.websocket.WebSocketFactory.upgrade(WebSocketFactory.java:201)
	at org.eclipse.jetty.websocket.WebSocketFactory.acceptWebSocket(WebSocketFactory.java:326)
	at org.eclipse.jetty.websocket.WebSocketHandler.handle(WebSocketHandler.java:38)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
	at org.eclipse.jetty.server.Server.handle(Server.java:346)
	at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:442)
	at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:924)
	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:582)
	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218)
	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
	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:662)
Comment 1 Joakim Erdfelt CLA 2012-01-12 12:47:05 EST
The stacktrace reported is from jetty 8.1.0.RC1

Here's the link to this version of the WebSocketFactory source.

https://github.com/eclipse/jetty.project/blob/jetty-8.1.0.RC1/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketFactory.java#L201
Comment 2 Joakim Erdfelt CLA 2012-01-12 13:12:25 EST
Created attachment 209396 [details]
Chrome websocket handshake testcase

Testcase used in attempt to replicate issue.
Comment 3 Joakim Erdfelt CLA 2012-01-12 13:13:53 EST
Closing as unable to duplicate.

Tested on ...
jetty-8.0.4.v20111024 (tag)
jetty-8.1.0.RC1 (tag)
jetty-8 (branch)
master (branch)

All versions pass testcase and show no NullPointerException from the server side (or client side).