Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] NPE in WebSocketServlet

Hi,

I still get the NullPointerException. I am using jetty-maven-plugin 7.0.1.20091125 and I pushed the maven project to github: http://github.com/benediktarnold/wsexamples

It would be nice if someone could have a look.

Regards,
Ben


-------- Original-Nachricht --------
> Datum: Thu, 31 Dec 2009 11:29:09 +0100
> Von: Benedikt Arnold <benedikt.arnold@xxxxxxx>
> An: JETTY user mailing list <jetty-users@xxxxxxxxxxx>
> Betreff: Re: [jetty-users] NPE in WebSocketServlet

> Hey Greg,
> 
> my first aproach was a bit simplified. It has only debug traces in the  
> WebSocket implementation.
> 
> I tried a strict copy and paste too but I got the same exception.
> 
> Cheers,
> Ben
> 
> Am 31.12.2009 um 04:21 schrieb Greg Wilkins <gregw@xxxxxxxxxxx>:
> 
> > Arnold,
> >
> > does the demo work for you?
> >
> > Have you altered the demo in any way?
> >
> > regards
> >
> >
> >
> >
> > Benedikt Arnold wrote:
> >> Hi,
> >> my name is Ben and I'm new to jetty users list.
> >>
> >> I want to try out websockets whith jetty 7.0.1 but I got a  
> >> NullPointerException in WebSocketServlet#service() on line 58  
> >> because the http object is null. See stacktrace below.
> >>
> >> My own implementation of WebSocketServlet is very simple:
> >>
> >> public class CountWebSocketServlet extends WebSocketServlet {
> >>
> >>    protected void doGet(HttpServletRequest request,
> >>            HttpServletResponse response) throws ServletException,  
> >> IOException {
> >>        getServletContext().getNamedDispatcher("default").forward 
> >> (request,
> >>                response);
> >>    }
> >>
> >>    protected WebSocket doWebSocketConnect(HttpServletRequest arg0,  
> >> String arg1) {
> >>        return new CountWebSocket();
> >>    }
> >> }
> >>
> >> Can anyone give me a hint or is this still a bug?
> >>
> >> Thanks a lot,
> >> Ben
> >>
> >>
> >> java.lang.NullPointerException
> >>    at org.eclipse.jetty.websocket.WebSocketServlet.service 
> >> (WebSocketServlet.java:58)
> >>    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> >>    at org.eclipse.jetty.servlet.ServletHolder.handle 
> >> (ServletHolder.java:530)
> >>    at org.eclipse.jetty.servlet.ServletHandler.doHandle 
> >> (ServletHandler.java:427)
> >>    at org.eclipse.jetty.server.handler.ScopedHandler.handle 
> >> (ScopedHandler.java:119)
> >>    at org.eclipse.jetty.security.SecurityHandler.handle 
> >> (SecurityHandler.java:457)
> >>    at org.eclipse.jetty.server.session.SessionHandler.handle 
> >> (SessionHandler.java:182)
> >>    at org.eclipse.jetty.server.handler.ContextHandler.doHandle 
> >> (ContextHandler.java:933)
> >>    at org.eclipse.jetty.servlet.ServletHandler.doScope 
> >> (ServletHandler.java:362)
> >>    at org.eclipse.jetty.server.handler.ContextHandler.doScope 
> >> (ContextHandler.java:867)
> >>    at org.eclipse.jetty.server.handler.ScopedHandler.handle 
> >> (ScopedHandler.java:117)
> >>    at  
> >> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle 
> >> (ContextHandlerCollection.java:245)
> >>    at org.eclipse.jetty.server.handler.HandlerCollection.handle 
> >> (HandlerCollection.java:126)
> >>    at org.eclipse.jetty.server.handler.HandlerWrapper.handle 
> >> (HandlerWrapper.java:113)
> >>    at org.eclipse.jetty.server.Server.handle(Server.java:334)
> >>    at org.eclipse.jetty.server.HttpConnection.handleRequest 
> >> (HttpConnection.java:559)
> >>    at org.eclipse.jetty.server.HttpConnection 
> >> $RequestHandler.headerComplete(HttpConnection.java:992)
> >>    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java: 
> >> 541)
> >>    at org.eclipse.jetty.http.HttpParser.parseAvailable 
> >> (HttpParser.java:203)
> >>    at org.eclipse.jetty.server.HttpConnection.handle 
> >> (HttpConnection.java:406)
> >>    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run 
> >> (SelectChannelEndPoint.java:462)
> >>    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run 
> >> (QueuedThreadPool.java:436)
> >>    at java.lang.Thread.run(Thread.java:619)
> >
> > _______________________________________________
> > jetty-users mailing list
> > jetty-users@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/jetty-users
> _______________________________________________
> jetty-users mailing list
> jetty-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jetty-users

-- 
http://wadenkrampf.blogspot.com



Back to the top