Saturday 22 May 2010

Web Socket and Jetty Error

Today I compiled the source code of WebSocketChatServlet and Web Socket (around sic java files in org.eclipse.jetty.websocket). I was able to make a war and deployed into the Jetty 7.0.2 server.

When I run the Web Socket chat application, I am getting runtime error..

>>>
java.lang.NullPointerException
at org.eclipse.jetty.websocket.WebSocketFactory.upgrade(WebSocketFactory
.java:92)
at org.eclipse.jetty.websocket.WebSocketServlet.service(WebSocketServlet
.java:60).

At line 92 of WebSocketFactory is a

ConnectedEndPoint endp = (ConnectedEndPoint)http.getEndPoint();

I don't know why it is throwing the line.

I guess I miss one or two jar files, I dont have idea what is exactly. If you know please write to me.

In Lib folder, I have six jars:
1. Jetty-Continuation.
2. Jetty Http
3. Jetty-io
4. Jetty-Server
5. Jetty-Servlets
6. Jetty-util


I will edit Web Socket java files and try to add more on this concept.

1 Comments:

At 9 June 2010 at 06:28 , Blogger Alessandro said...

You need jetty-websocket also.

If you use Maven, add a dependency at jetty-maven-plugin as follows:



org.eclipse.jetty
jetty-websocket
7.0.1.v20091125
jar

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home