glassfish
  1. glassfish
  2. GLASSFISH-20702

Various exceptions after calling Session.close() in a WebSocket application

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      GlassFish 4.0.1-b02-07_15_2013, 4.0.1-b02-07_12_2013
      Java 1.7.0_21 64 Bit
      Windows 7 64 Bit
      8 CPU threads
      Firefox 22

      Description

      In an application using websockets, I experience various exceptions when calling Session.close().

      I made a simple testcase to reproduce, however, the exceptions occur randomly. Best chances are when hitting the connect button multiple times in a row, quickly. It doesn't seem to matter if there are multiple threads or just one calling Session.close(), as I also experienced exceptions when closing all open sessions one after another in a @Schedule method.

      DemoEndpoint.java
      package glassfishbugs;
      
      import java.util.logging.Level;
      import java.util.logging.Logger;
      import javax.websocket.CloseReason;
      import javax.websocket.OnClose;
      import javax.websocket.OnError;
      import javax.websocket.OnOpen;
      import javax.websocket.Session;
      import javax.websocket.server.ServerEndpoint;
      
      @ServerEndpoint("/websocket/demo")
      public class DemoEndpoint {
      
          private static final Logger LOG = Logger.getLogger(DemoEndpoint.class.getName());
      
          @OnOpen
          public void onOpen(final Session session) {
              LOG.log(Level.INFO, "onOpen, session: {0}", session);
              scheduleClose(session);
          }
      
          @OnClose
          public void onClose(final Session session, final CloseReason reason) {
              LOG.log(Level.INFO, "onClose, session: {0}, reason: {1}", new Object[]{session, reason});
          }
      
          @OnError
          public void onError(final Session session, final Throwable cause) {
              LOG.log(Level.INFO, "onError, session: " + session, cause);
          }
      
          private void scheduleClose(final Session session) {
              new Thread(new CloseRunnable(session)).start();
          }
      }
      
      CloseRunnable.java
      package glassfishbugs;
      
      import java.io.IOException;
      import java.util.logging.Level;
      import java.util.logging.Logger;
      import javax.websocket.Session;
      
      public class CloseRunnable implements Runnable {
      
          private static final Logger LOG = Logger.getLogger(CloseRunnable.class.getName());
          private static final int TIMEOUT = 1000;
          private final Session SESSION;
      
          public CloseRunnable(final Session session) {
              this.SESSION = session;
          }
      
          @Override
          public void run() {
              try {
                  Thread.sleep(TIMEOUT);
              } catch (InterruptedException ex) {
                  LOG.log(Level.SEVERE, "Interrupted", ex);
              }
              try {
                  SESSION.close();
              } catch (IOException | IllegalStateException ex) {
                  LOG.log(Level.SEVERE, "Exception while closing session " + SESSION, ex);
              }
          }
      }
      
      index.xhtml
      <!DOCTYPE html>
      <html>
          <head>
              <title>Demo</title>
              <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
          </head>
          <body>
              <h1>Demo</h1>
              <script type="application/javascript">
                  "use strict";
      
                  var host, port, path, uri;
                  host = window.location.hostname;
                  port = window.location.port || (window.location.protocol === 'https:' ? 443 : 80);
                  path = location.pathname + 'websocket/demo';
                  uri = 'ws://' + host + ':' + port + path;
      
                  var ws;
      
                  function connect(){
                      log('Connecting to ' + uri);
                      ws = new WebSocket(uri);
                      var a = ['open', 'close', 'message', 'error'];
                      for(var i in a) {
                          var s = a[i];
                          if(typeof s === 'string') {
                              ws['on' + s] = function(e) {
                                  log(e);
                              }
                          }
                      }
                  }
      
                  function log() {
                      if(typeof console !== 'undefined') {
                          try {
                              console.log.apply(this, arguments);
                          } catch(ex) {}
                      }
                  }
              </script>
              <p>
                  <input type="button" value="Connect" onclick="connect();" style="font-size:xx-large;"/>
              </p>
          </body>
      </html>
      

      Using glassfish-4.0.1-b02-07_15_2013 I got the following exceptions:

      WARNING:   service exception
      java.lang.NullPointerException
      	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:163)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:187)
      	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:837)
      	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
      	at java.lang.Thread.run(Thread.java:722)
      
      WARNING:   Exception during HttpHandler invokation
      java.lang.IllegalStateException: Internal org.glassfish.grizzly.http.server.Response has not been set
      	at org.glassfish.grizzly.http.server.Response.checkResponse(Response.java:1840)
      	at org.glassfish.grizzly.http.server.Response.setStatus(Response.java:1488)
      	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:171)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:187)
      	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:837)
      	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
      	at java.lang.Thread.run(Thread.java:722)
      
      WARNING:   Exception during FilterChain execution
      java.lang.NullPointerException
      	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:196)
      	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:837)
      	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
      	at java.lang.Thread.run(Thread.java:722)
      
      WARNING:   onError!
      java.io.IOException: Stream closed
      	at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:265)
      	at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:234)
      	at org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.fillBuf(TyrusHttpUpgradeHandler.java:141)
      	at org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.onDataAvailable(TyrusHttpUpgradeHandler.java:104)
      	at org.apache.catalina.connector.InputBuffer$ReadHandlerImpl.processDataAvailable(InputBuffer.java:488)
      	at org.apache.catalina.connector.InputBuffer$ReadHandlerImpl.onDataAvailable(InputBuffer.java:453)
      	at org.glassfish.grizzly.http.io.InputBuffer.append(InputBuffer.java:855)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:220)
      	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:837)
      	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
      	at java.lang.Thread.run(Thread.java:722)
      
      SEVERE:   An exception or error occurred in the container during the request processing
      java.lang.NullPointerException
      	at org.glassfish.grizzly.http.Method.<init>(Method.java:139)
      	at org.glassfish.grizzly.http.Method.CUSTOM(Method.java:79)
      	at org.glassfish.grizzly.http.Method.CUSTOM(Method.java:74)
      	at org.glassfish.grizzly.http.Method.valueOf(Method.java:102)
      	at org.glassfish.grizzly.http.HttpRequestPacket.getMethod(HttpRequestPacket.java:172)
      	at org.glassfish.grizzly.http.server.Request.getMethod(Request.java:1684)
      	at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:576)
      	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:298)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
      	at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:496)
      	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:175)
      	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
      	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:187)
      	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:837)
      	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
      	at java.lang.Thread.run(Thread.java:722)
      
      WARNING:   ACTION_CLIENT_FLUSH
      java.lang.NullPointerException
      	at org.apache.catalina.connector.OutputBuffer$SessionCookieChecker.onCommit(OutputBuffer.java:747)
      	at org.glassfish.grizzly.http.io.OutputBuffer.notifyCommit(OutputBuffer.java:1170)
      	at org.glassfish.grizzly.http.io.OutputBuffer.doCommit(OutputBuffer.java:1070)
      	at org.glassfish.grizzly.http.io.OutputBuffer.close(OutputBuffer.java:708)
      	at org.glassfish.grizzly.http.io.OutputBuffer.endRequest(OutputBuffer.java:367)
      	at org.glassfish.grizzly.http.server.Response.finish(Response.java:501)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.afterService(HttpServerFilter.java:317)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:212)
      	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:837)
      	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
      	at java.lang.Thread.run(Thread.java:722)
      
      WARNING:   Response Error during finishResponse
      java.lang.NullPointerException
      	at org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:263)
      	at org.apache.catalina.connector.Response.finishResponse(Response.java:628)
      	at org.apache.catalina.connector.CoyoteAdapter$CatalinaAfterServiceListener.onAfterService(CoyoteAdapter.java:1037)
      	at org.glassfish.grizzly.http.server.Request.onAfterService(Request.java:558)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.afterService(HttpServerFilter.java:318)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:212)
      	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:837)
      	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
      	at java.lang.Thread.run(Thread.java:722)
      
      WARNING:   Exception during FilterChain execution
      java.lang.NullPointerException
      	at org.glassfish.grizzly.http.HttpResponsePacketImpl.recycle(HttpResponsePacketImpl.java:94)
      	at org.glassfish.grizzly.http.server.Response.recycle(Response.java:310)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.afterService(HttpServerFilter.java:329)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:212)
      	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:837)
      	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
      	at java.lang.Thread.run(Thread.java:722)
      
      SEVERE:   An exception or error occurred in the container during the request processing
      java.lang.IllegalStateException: Cannot call sendError() after the response has been committed
      	at org.apache.catalina.connector.Response.sendError(Response.java:1404)
      	at org.apache.catalina.connector.Response.sendError(Response.java:1386)
      	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:347)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
      	at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:496)
      	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:175)
      	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
      	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:187)
      	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:837)
      	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
      	at java.lang.Thread.run(Thread.java:722)
      
      WARNING:   Response Error during finishResponse
      java.lang.NullPointerException
      	at org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:263)
      	at org.apache.catalina.connector.Response.finishResponse(Response.java:628)
      	at org.apache.catalina.connector.CoyoteAdapter$CatalinaAfterServiceListener.onAfterService(CoyoteAdapter.java:1037)
      	at org.glassfish.grizzly.http.server.Request.onAfterService(Request.java:558)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.afterService(HttpServerFilter.java:318)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:212)
      	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:837)
      	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
      	at java.lang.Thread.run(Thread.java:722)
      
      WARNING:   Exception during FilterChain execution
      java.lang.NullPointerException
      	at org.glassfish.grizzly.http.HttpResponsePacketImpl.recycle(HttpResponsePacketImpl.java:94)
      	at org.glassfish.grizzly.http.server.Response.recycle(Response.java:310)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.afterService(HttpServerFilter.java:329)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:212)
      	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:837)
      	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
      	at java.lang.Thread.run(Thread.java:722)
      

      Using glassfish-4.0.1-b02-07_12_2013 (I don't know if those exceptions could also happen with the current version) I also got:

      WARNING:   Error invoking requestInitialized method on ServletRequestListener org.jboss.weld.servlet.WeldListener
      java.util.ConcurrentModificationException
      	at java.util.HashMap$HashIterator.nextEntry(HashMap.java:894)
      	at java.util.HashMap$KeyIterator.next(HashMap.java:928)
      	at org.apache.catalina.util.Enumerator.<init>(Enumerator.java:136)
      	at org.apache.catalina.util.Enumerator.<init>(Enumerator.java:106)
      	at org.apache.catalina.connector.Request.getAttributeNames(Request.java:1419)
      	at org.apache.catalina.connector.RequestFacade.getAttributeNames(RequestFacade.java:367)
      	at org.jboss.weld.context.beanstore.http.RequestBeanStore.getAttributeNames(RequestBeanStore.java:48)
      	at org.jboss.weld.context.beanstore.AttributeBeanStore.getPrefixedAttributeNames(AttributeBeanStore.java:207)
      	at org.jboss.weld.context.beanstore.AttributeBeanStore.attach(AttributeBeanStore.java:106)
      	at org.jboss.weld.context.http.HttpRequestContextImpl.associate(HttpRequestContextImpl.java:52)
      	at org.jboss.weld.context.http.HttpRequestContextImpl.associate(HttpRequestContextImpl.java:37)
      	at org.jboss.weld.servlet.WeldListener.requestInitialized(WeldListener.java:190)
      	at org.apache.catalina.core.StandardContext.fireRequestInitializedEvent(StandardContext.java:5257)
      	at org.apache.catalina.core.StandardHostValve.preInvoke(StandardHostValve.java:655)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:166)
      	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:359)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
      	at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:496)
      	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:175)
      	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
      	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:187)
      	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:837)
      	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
      	at java.lang.Thread.run(Thread.java:722)
      
      WARNING:   Error invoking requestInitialized method on ServletRequestListener org.jboss.weld.servlet.WeldListener
      java.lang.IllegalStateException: Unable to load current conversations from the associated request, something went badly wrong when associate() was called
      	at org.jboss.weld.context.AbstractConversationContext.getConversationMap(AbstractConversationContext.java:383)
      	at org.jboss.weld.context.AbstractConversationContext.getConversations(AbstractConversationContext.java:375)
      	at org.jboss.weld.context.AbstractConversationContext.invalidate(AbstractConversationContext.java:288)
      	at org.jboss.weld.servlet.ConversationContextActivator.deactivateConversationContext(ConversationContextActivator.java:153)
      	at org.jboss.weld.servlet.WeldListener.requestDestroyed(WeldListener.java:152)
      	at org.jboss.weld.servlet.WeldListener.requestInitialized(WeldListener.java:205)
      	at org.apache.catalina.core.StandardContext.fireRequestInitializedEvent(StandardContext.java:5257)
      	at org.apache.catalina.core.StandardHostValve.preInvoke(StandardHostValve.java:655)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:166)
      	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:359)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
      	at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:496)
      	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:175)
      	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
      	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:187)
      	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:837)
      	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
      	at java.lang.Thread.run(Thread.java:722)
      
      SEVERE:   An exception or error occurred in the container during the request processing
      java.lang.NullPointerException
      	at org.apache.catalina.connector.Request.setAttribute(Request.java:2021)
      	at org.apache.catalina.connector.RequestFacade.setAttribute(RequestFacade.java:585)
      	at org.apache.catalina.core.StandardContext.fireRequestInitializedEvent(StandardContext.java:5262)
      	at org.apache.catalina.core.StandardHostValve.preInvoke(StandardHostValve.java:655)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:166)
      	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:359)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
      	at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:496)
      	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:175)
      	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
      	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:187)
      	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:837)
      	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
      	at java.lang.Thread.run(Thread.java:722)
      
      WARNING:   Response Error during finishResponse
      java.lang.NullPointerException
      	at org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:263)
      	at org.apache.catalina.connector.Response.finishResponse(Response.java:628)
      	at org.apache.catalina.connector.CoyoteAdapter$CatalinaAfterServiceListener.onAfterService(CoyoteAdapter.java:1037)
      	at org.glassfish.grizzly.http.server.Request.onAfterService(Request.java:558)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.afterService(HttpServerFilter.java:318)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:212)
      	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:837)
      	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
      	at java.lang.Thread.run(Thread.java:722)
      

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            michael.y.chen
            Reporter:
            kithouna
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: