Thursday, November 20, 2014

Websockets using GWT - Best practice

Hi,

I'm currently trying to establish a websocket connection in GWT 2.6 and 2.7 using gwt-ws.

My question:
the Google search points me to the gwt-ws project to implement websocket connections. But the code examples there do not work with the jetty version included in GWT 2.6 and 2.7
Is there a best practice to do it know? Any known code examples you can point me to?

More infos about the problem:
The server (coded as shown at "Getting Started" https://code.google.com/p/gwt-ws/)throws an AbstractMethodExeption.
Here is the full StackTrace

java.lang.AbstractMethodError: de.csenk.gwt.ws.server.jetty.JettyWebSocketConnection.onOpen(Lorg/eclipse/jetty/websocket/WebSocket$Connection;)V
 at org
.eclipse.jetty.websocket.WebSocketConnectionRFC6455.onWebSocketOpen(WebSocketConnectionRFC6455.java:425)
 at org
.eclipse.jetty.websocket.WebSocketServletConnectionRFC6455.handshake(WebSocketServletConnectionRFC6455.java:60)
 at org
.eclipse.jetty.websocket.WebSocketFactory.upgrade(WebSocketFactory.java:323)
 at org
.eclipse.jetty.websocket.WebSocketFactory.acceptWebSocket(WebSocketFactory.java:396)
 at org
.eclipse.jetty.websocket.WebSocketServlet.service(WebSocketServlet.java:104)
 at javax
.servlet.http.HttpServlet.service(HttpServlet.java:848)
 at org
.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
 at org
.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
 at org
.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
 at org
.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
 at org
.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
 at org
.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
 at org
.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
 at org
.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
 at org
.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
 at org
.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
 at org
.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
 at org
.eclipse.jetty.server.Server.handle(Server.java:370)
 at org
.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
 at org
.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:949)
 at org
.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1011)
 at org
.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
 at org
.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
 at org
.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
 at org
.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
 at org
.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
 at org
.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
 at org
.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
 at java
.lang.Thread.run(Thread.java:744)


Seems like the onOpen() method was added in the WebSocket interface
The implementation de.csenk.gwt.ws.server.jetty.JettyWebSocketConnection seems to implement an older WebSocket interface without onOpen method.

thanks in advance!!
Andy

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment