| Summary: | NullPointerException when Outbound disconnect() called | ||
|---|---|---|---|
| Product: | [RT] Jetty | Reporter: | Jeremy Stone <jeremy.stone> |
| Component: | server | Assignee: | Greg Wilkins <gregw> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | jetty-inbox, mgorovoy |
| Version: | unspecified | ||
| Target Milestone: | 7.0.2.RC0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
fixed in r1996. thanks for the report. fixed in r1996. thanks for the report. |
Build Identifier: 7.1.3.v20100526 Calling disconnect() on a Websocket.Outbound instance causes NPE when an attempt is made to flush a null buffer. Here are the top few lines of the stack trace... java.lang.NullPointerException at org.eclipse.jetty.websocket.WebSocketGenerator.expelBuffer(WebSocketGenerator.java:138) at org.eclipse.jetty.websocket.WebSocketGenerator.flush(WebSocketGenerator.java:110) at org.eclipse.jetty.websocket.WebSocketConnection.disconnect(WebSocketConnection.java:191) at ... Simply changing WebSocketGenerator.flush(long) to the following may be enough to fix it: public synchronized int flush(long blockFor) throws IOException { if (_buffer==null) return 0; return expelBuffer(blockFor); } Reproducible: Always