java.lang.IllegalStateException: Not Suspended

Oracle Community | 392 Guest | 5 years ago
  1. Speed up your debug routine!

    Automated exception search integrated into your IDE

  2. 0

    When using Comet Servlet 3 Push of ZK 6.5.1.1 EE on GlassFish 3.1.2 an IllegalStateException is thrown by Grizzly. {code} [#|2013-07-24T15:28:56.897+0200|WARNING|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=22;_ThreadName=Thread-2;|StandardWrapperValve[CometAsyncServlet]: PWC1406: Servlet.service() for servlet CometAsyncServlet threw exception java.lang.IllegalStateException: Not Suspended at com.sun.grizzly.tcp.Response.resume(Response.java:768) at org.apache.catalina.connector.Request.asyncComplete(Request.java:3993) at org.apache.catalina.connector.AsyncContextImpl.complete(AsyncContextImpl.java:242) at org.zkoss.zkmax.ui.comet.CometAsyncServlet$AsyncInfo.complete(CometAsyncServlet.java:153) at org.zkoss.zkex.ui.comet.CometServerPush.cleanAsyncInfo(CometServerPush.java:316) at org.zkoss.zkex.ui.comet.CometServerPush.processRequest(CometServerPush.java:248) at org.zkoss.zkmax.ui.comet.CometServerPush.processRequest(CometServerPush.java:107) at org.zkoss.zkmax.ui.comet.CometAsyncServlet.doPost(CometAsyncServlet.java:117) at javax.servlet.http.HttpServlet.service(HttpServlet.java:688) at javax.servlet.http.HttpServlet.service(HttpServlet.java:770) at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231) at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228) 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:662) |#] {code} The exception is thrown when the following steps happen: *First request:* CometAsyncServlet.doPost() is called which starts a new AsyncContext. This calls com.sun.grizzly.tcp.Response.suspend() on instance A. Back in CometAsyncServlet, CometServerPush.processRequest() is called which leads to Response.resume() is called on instance A. Everything works fine. *Second request:* CometAsyncServlet.doPost() is called which starts a new AsyncContext. This calls com.sun.grizzly.tcp.Response.suspend() on instance B. Back in CometAsyncServlet, CometServerPush.processRequest() is called. AsyncInfo's complete() method is called, which leads to Response.resume() beeing called for instance A. But this method has been called before during the first request, so the Grizzly implementation throws an IllegalStateException, which leads to a call of Response.reset() on instance B. Afterwards Response.resume() is called on instance B, which again throws an IllegalStateException. In my opinion the best solution to this problem is to catch the IllegalStateException in AsyncInfo.complete() method.

    ZK-Tracker | 3 years ago | jkraushaar
    java.lang.IllegalStateException: Not Suspended
  3. 0

    When using Comet Servlet 3 Push of ZK 6.5.1.1 EE on GlassFish 3.1.2 an IllegalStateException is thrown by Grizzly. {code} [#|2013-07-24T15:28:56.897+0200|WARNING|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=22;_ThreadName=Thread-2;|StandardWrapperValve[CometAsyncServlet]: PWC1406: Servlet.service() for servlet CometAsyncServlet threw exception java.lang.IllegalStateException: Not Suspended at com.sun.grizzly.tcp.Response.resume(Response.java:768) at org.apache.catalina.connector.Request.asyncComplete(Request.java:3993) at org.apache.catalina.connector.AsyncContextImpl.complete(AsyncContextImpl.java:242) at org.zkoss.zkmax.ui.comet.CometAsyncServlet$AsyncInfo.complete(CometAsyncServlet.java:153) at org.zkoss.zkex.ui.comet.CometServerPush.cleanAsyncInfo(CometServerPush.java:316) at org.zkoss.zkex.ui.comet.CometServerPush.processRequest(CometServerPush.java:248) at org.zkoss.zkmax.ui.comet.CometServerPush.processRequest(CometServerPush.java:107) at org.zkoss.zkmax.ui.comet.CometAsyncServlet.doPost(CometAsyncServlet.java:117) at javax.servlet.http.HttpServlet.service(HttpServlet.java:688) at javax.servlet.http.HttpServlet.service(HttpServlet.java:770) at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231) at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228) 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:662) |#] {code} The exception is thrown when the following steps happen: *First request:* CometAsyncServlet.doPost() is called which starts a new AsyncContext. This calls com.sun.grizzly.tcp.Response.suspend() on instance A. Back in CometAsyncServlet, CometServerPush.processRequest() is called which leads to Response.resume() is called on instance A. Everything works fine. *Second request:* CometAsyncServlet.doPost() is called which starts a new AsyncContext. This calls com.sun.grizzly.tcp.Response.suspend() on instance B. Back in CometAsyncServlet, CometServerPush.processRequest() is called. AsyncInfo's complete() method is called, which leads to Response.resume() beeing called for instance A. But this method has been called before during the first request, so the Grizzly implementation throws an IllegalStateException, which leads to a call of Response.reset() on instance B. Afterwards Response.resume() is called on instance B, which again throws an IllegalStateException. In my opinion the best solution to this problem is to catch the IllegalStateException in AsyncInfo.complete() method.

    ZK-Tracker | 3 years ago | jkraushaar
    java.lang.IllegalStateException: Not Suspended

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalStateException

      Not Suspended

      at com.sun.grizzly.tcp.Response.resume()
    2. Grizzly WS
      Response.resume
      1. com.sun.grizzly.tcp.Response.resume(Response.java:768)
      1 frame
    3. Glassfish Core
      AsyncContextImpl.complete
      1. org.apache.catalina.connector.Request.asyncComplete(Request.java:3991)
      2. org.apache.catalina.connector.AsyncContextImpl.complete(AsyncContextImpl.java:242)
      2 frames
    4. org.icepush.servlet
      AsyncAdaptingServlet$AsyncRequestResponse.respondWith
      1. org.icepush.servlet.AsyncAdaptingServlet$AsyncRequestResponse.respondWith(AsyncAdaptingServlet.java:66)
      1 frame
    5. org.icepush
      ConfigurationServer.service
      1. org.icepush.BlockingConnectionServer.respondIfPendingRequest(BlockingConnectionServer.java:131)
      2. org.icepush.BlockingConnectionServer.respondIfPendingRequest(BlockingConnectionServer.java:133)
      3. org.icepush.BlockingConnectionServer.access$700(BlockingConnectionServer.java:41)
      4. org.icepush.BlockingConnectionServer$RunningServer.service(BlockingConnectionServer.java:198)
      5. org.icepush.BlockingConnectionServer.service(BlockingConnectionServer.java:76)
      6. org.icepush.ConfigurationServer.service(ConfigurationServer.java:87)
      6 frames
    6. org.icepush.servlet
      MainServlet.service
      1. org.icepush.servlet.AsyncAdaptingServlet.service(AsyncAdaptingServlet.java:47)
      2. org.icepush.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:51)
      3. org.icepush.servlet.PathDispatcher.service(PathDispatcher.java:45)
      4. org.icepush.servlet.BrowserDispatcher$BrowserEntry.service(BrowserDispatcher.java:111)
      5. org.icepush.servlet.BrowserDispatcher.service(BrowserDispatcher.java:50)
      6. org.icepush.servlet.PathDispatcher.service(PathDispatcher.java:45)
      7. org.icepush.servlet.MainServlet.service(MainServlet.java:72)
      7 frames
    7. org.vaadin.artur
      ICEPushServlet.service
      1. org.vaadin.artur.icepush.ICEPushServlet.service(ICEPushServlet.java:62)
      1 frame