glassfish
  1. glassfish
  2. GLASSFISH-18856

NPE with WebSocket and HttpServletRequest.getSession()

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.2
    • Fix Version/s: 3.1.2
    • Component/s: grizzly-kernel
    • Labels:
      None

      Description

      Trying to get a session from the first WebSocket requests cause the following NPE. You can easily reproduce by downloading atmosphere-chat.war

      [#|2012-06-29T10:46:47.952-0400|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=19;_ThreadName=http-thread-pool-8080(5);|java.lang.NullPointerException
      	at com.sun.grizzly.tcp.http11.GrizzlyRequest.doGetSession(GrizzlyRequest.java:2271)
      	at com.sun.grizzly.tcp.http11.GrizzlyRequest.getSession(GrizzlyRequest.java:2226)
      	at com.sun.grizzly.http.servlet.HttpServletRequestImpl.getSession(HttpServletRequestImpl.java:986)
      	at org.atmosphere.cpr.AtmosphereRequest.getSession(AtmosphereRequest.java:600)
      	at org.atmosphere.cpr.AtmosphereResourceImpl.<init>(AtmosphereResourceImpl.java:161)
      	at org.atmosphere.cpr.AtmosphereResourceFactory.create(AtmosphereResourceFactory.java:70)
      	at org.atmosphere.websocket.WebSocketProcessor.dispatch(WebSocketProcessor.java:103)
      	at org.atmosphere.container.GlassFishWebSocketSupport$GrizzlyApplication.onConnect(GlassFishWebSocketSupport.java:158)
      	at com.sun.grizzly.websockets.DefaultWebSocket.onConnect(DefaultWebSocket.java:128)
      	at com.sun.grizzly.websockets.WebSocketEngine.upgrade(WebSocketEngine.java:188)
      	at com.sun.grizzly.websockets.WebSocketAsyncFilter.doFilter(WebSocketAsyncFilter.java:54)
      	at com.sun.grizzly.arp.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:171)
      	at com.sun.grizzly.arp.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:143)
      	at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:102)
      	at com.sun.grizzly.http.TaskBase.run(TaskBase.java:193)
      	at com.sun.grizzly.http.TaskBase.execute(TaskBase.java:175)
      	at com.sun.grizzly.arp.DefaultAsyncHandler.handle(DefaultAsyncHandler.java:145)
      	at com.sun.grizzly.arp.AsyncProtocolFilter.execute(AsyncProtocolFilter.java:210)
      	at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
      	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
      	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
      	at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
      	at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
      	at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
      	at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
      	at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
      	at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
      	at java.lang.Thread.run(Thread.java:680)
      |#]
      

        Activity

        Hide
        Ryan Lubke added a comment -

        Logged with the Grizzly project as http://java.net/jira/browse/GRIZZLY-1270.

        Fixed as part of 1.9.50.

        Show
        Ryan Lubke added a comment - Logged with the Grizzly project as http://java.net/jira/browse/GRIZZLY-1270 . Fixed as part of 1.9.50.
        Hide
        Ryan Lubke added a comment -

        Marking this as resolved in 3.1.2 but in fact this will be fixed in 3.1.2.2 which will be released to the public soon (TM).

        Show
        Ryan Lubke added a comment - Marking this as resolved in 3.1.2 but in fact this will be fixed in 3.1.2.2 which will be released to the public soon (TM).

          People

          • Assignee:
            Ryan Lubke
            Reporter:
            jfarcand
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: