java.lang.IllegalStateException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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.
    via by jkraushaar,
  • 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.
    via by jkraushaar,
    • java.lang.IllegalStateException: Not Suspended at org.icepush.BlockingConnectionServer.respondIfPendingRequest(BlockingConnectionServer.java:133) at org.icepush.BlockingConnectionServer.access$700(BlockingConnectionServer.java:41) at org.icepush.BlockingConnectionServer$RunningServer.service(BlockingConnectionServer.java:198) at org.icepush.BlockingConnectionServer.service(BlockingConnectionServer.java:76) at org.icepush.ConfigurationServer.service(ConfigurationServer.java:87) at org.icepush.servlet.AsyncAdaptingServlet.service(AsyncAdaptingServlet.java:47) at org.icepush.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:51) at org.icepush.servlet.PathDispatcher.service(PathDispatcher.java:45) at org.icepush.servlet.BrowserDispatcher$BrowserEntry.service(BrowserDispatcher.java:111) at org.icepush.servlet.BrowserDispatcher.service(BrowserDispatcher.java:50) at org.icepush.servlet.PathDispatcher.service(PathDispatcher.java:45) at org.icepush.servlet.MainServlet.service(MainServlet.java:72) at org.vaadin.artur.icepush.ICEPushServlet.service(ICEPushServlet.java:62) Caused by: java.lang.IllegalStateException: Not Suspended at com.sun.grizzly.tcp.Response.resume(Response.java:768) at org.apache.catalina.connector.Request.asyncComplete(Request.java:3991) at org.apache.catalina.connector.AsyncContextImpl.complete(AsyncContextImpl.java:242) at org.icepush.servlet.AsyncAdaptingServlet$AsyncRequestResponse.respondWith(AsyncAdaptingServlet.java:66) at org.icepush.BlockingConnectionServer.respondIfPendingRequest(BlockingConnectionServer.java:131) ... 13 more
    No Bugmate found.