has anyone an idea, how to run my app in DevMode with a working WebsocketConnection?
First I thought the missing jetty jars (websocket, continuation, http, io, server and util) were the reason for errors, because when i compiled the app and put it on an external jetty, there was no problem with WebsocketConnection.
So i searched for them and added them to my project.
But now everytime i start it in DevMode i get an exceptionlike this:
[WARN] /testchat/WebSocketChatServlet
java.lang.NullPointerException
at org.eclipse.jetty.websocket.WebSocketFactory.upgrade(WebSocketFactory.java:197)
at org.eclipse.jetty.websocket.WebSocketFactory.acceptWebSocket(WebSocketFactory.java:304)
at org.eclipse.jetty.websocket.WebSocketServlet.service(WebSocketServlet.java:78)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:829)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
[ERROR] 500 – GET /testchat/WebSocketChatServlet (127.0.0.1) 3129 bytes
DevMode’s embedded server is Jetty 6, which doesn’t support WebSockets. Google tried to upgrade it to Jetty 7 a couple years ago, but there were issues with classloaders that they couldn’t work out.
The only way to use WebSockets is to use an external server (or, if you can solve the classloading issues, write your own
ServletContainerLauncher) and run DevMode in-noservermode.See Using my own server in development mode instead of GWT’s built-in Jetty instance