Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Jetty and WebSockets

You mentioned manifest, are you using OSGi ?

Joakim Erdfelt <joakim@xxxxxxxxxxx>
Expert advice, services and support from from the Jetty & CometD experts

On Tue, Aug 20, 2013 at 12:29 PM, Joakim Erdfelt <joakim@xxxxxxxxxxx> wrote:
Odd, very odd.

You are definately using websocket correctly, and your servlet is being hit.
However, these 2 lines are causing a NPE for you.

Now why is HttpConnection.getCurrentConnection() null for you?

The HttpConnection:229 is present on your stacktrace.
And a few lines above that handle method is the setting of your current connection.

That is a very strange bug you are experiencing.
What JDK are you using? And on what OS?
I'd like to attempt to replicate.

Joakim Erdfelt <joakim@xxxxxxxxxxx>
Expert advice, services and support from from the Jetty & CometD experts

On Tue, Aug 20, 2013 at 12:04 PM, Sebastian Gutierrez <scgm11@xxxxxxxxx> wrote:
I've move a bit forward:


this is the exception...

 2013-08-16 20:42:35.458:WARN:oejs.ServletHandler:qtp1118598848-18: /Integra/websockets/
        at org.eclipse.jetty.websocket.server.WebSocketServerFactory.upgrade(
        at org.eclipse.jetty.websocket.server.WebSocketServerFactory.acceptWebSocket(
        at org.eclipse.jetty.websocket.servlet.WebSocketServlet.service(
        at javax.servlet.http.HttpServlet.service(
        at org.eclipse.jetty.servlet.ServletHolder.handle(
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(
        at org.eclipse.jetty.servlet.ServletHandler.doScope(
        at org.eclipse.jetty.server.session.SessionHandler.doScope(
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(
        at org.eclipse.jetty.server.handler.HandlerList.handle(
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
        at org.eclipse.jetty.server.Server.handle(
        at org.eclipse.jetty.server.HttpChannel.handle(
        at org.eclipse.jetty.server.HttpConnection.onFillable(
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
        at org.eclipse.jetty.util.thread.QueuedThreadPool$

maybe this is wrong on my xml:




On August 20, 2013 at 3:47:34 PM, Sebastian Gutierrez (scgm11@xxxxxxxxx) wrote:

forget about this, is the manifest wrong…

On August 20, 2013 at 3:35:19 PM, Sebastian Gutierrez (scgm11@xxxxxxxxx) wrote:

is there any breaking changes for embedded between 9.0.3 and 9.04 and 9.05 because I'm moving from 3 to 5 and now I have 
this exception

root@server:/etc/IntegraServer/server# Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/jetty/server/HttpConfiguration$Customizer
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(
        at java.lang.Class.getMethod0(
        at java.lang.Class.getMethod(
        at sun.launcher.LauncherHelper.getMainMethod(
        at sun.launcher.LauncherHelper.checkAndLoadMain(
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.HttpConfiguration$Customizer
        at Method)
        at java.lang.ClassLoader.loadClass(
        at sun.misc.Launcher$AppClassLoader.loadClass(
        at java.lang.ClassLoader.loadClass(
        ... 6 more

although the class seems to be on the jetty server jar……

any idea??

then I will move further on the web socket issue, 9.0.3 doesn't have a web socket client jar..

On August 20, 2013 at 2:52:19 PM, Joakim Erdfelt (joakim@xxxxxxxxxxx) wrote:


And then type in your websocket uri and try it out.

Joakim Erdfelt <joakim@xxxxxxxxxxx>
Expert advice, services and support from from the Jetty & CometD experts

On Tue, Aug 20, 2013 at 10:43 AM, Sebastian Gutierrez <scgm11@xxxxxxxxx> wrote:
that's exactly as I have done, but it seems that JettyWebSocketServlet never gets executed, for example if I add some log on the configure override method, that one is never executed. when the server start, maybe it does´t get executed until the first request or something like that?? is there any simple way to test the web socket? lets say pasting the url on a web browser that supports them?? or is there any thin client out there to check it?

any other pointer??

thanks a lot!

On August 20, 2013 at 2:35:52 PM, Joakim Erdfelt (joakim@xxxxxxxxxxx) wrote:

hine.hostname" is your server's host name (or ip)
The "port" is the non-SSL port you have configured your server on.
The "webapp.context" is the context path where you deployed your web application
and "/websockets/" is the request path you have specified in your servlet-mapping

Back to the top