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:

9.0.5



this is the exception...


 2013-08-16 20:42:35.458:WARN:oejs.ServletHandler:qtp1118598848-18: /Integra/websockets/
java.lang.NullPointerException
        at org.eclipse.jetty.websocket.server.WebSocketServerFactory.upgrade(WebSocketServerFactory.java:415)
        at org.eclipse.jetty.websocket.server.WebSocketServerFactory.acceptWebSocket(WebSocketServerFactory.java:178)
        at org.eclipse.jetty.websocket.servlet.WebSocketServlet.service(WebSocketServlet.java:160)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:698)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:505)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:138)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:564)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:213)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1096)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:432)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:175)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1030)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136)
        at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
        at org.eclipse.jetty.server.Server.handle(Server.java:445)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:268)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:229)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.run(AbstractConnection.java:358)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:601)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:532)
        at java.lang.Thread.run(Thread.java:722)


maybe this is wrong on my xml:

 <servlet-mapping>
        <servlet-name>servlet</servlet-name>
        <url-pattern>/websockets/*</url-pattern>
    </servlet-mapping>

?

thanks!

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(Class.java:2451)
        at java.lang.Class.getMethod0(Class.java:2694)
        at java.lang.Class.getMethod(Class.java:1622)
        at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.HttpConfiguration$Customizer
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
        ... 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:

Yeah.

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