java.lang.IllegalStateException: Calling [asyncComplete()] is not valid for a request with Async state [COMPLETING]

2014-11-25 Thread Vicky
Hi Folks, I am using Tomcat 7.0.42, in embedded mode, using NIO connector. Running on a linux box. I use request.startAsync() to create an AsyncContext. And call complete() once everything is done. But complete() is called via a separate thread. Any idea why am i getting this exception?

Re: java.lang.IllegalStateException: Calling [asyncComplete()] is not valid for a request with Async state [COMPLETING]

2014-11-25 Thread Mark Thomas
On 25/11/2014 13:01, Vicky wrote: Hi Folks, I am using Tomcat 7.0.42, in embedded mode, using NIO connector. Running on a linux box. I use request.startAsync() to create an AsyncContext. And call complete() once everything is done. But complete() is called via a separate thread. Any

Re: java.lang.IllegalStateException: Calling [asyncComplete()] is not valid for a request with Async state [COMPLETING]

2014-11-25 Thread Vicky
Thanks Mark. However i don't think, i am calling it twice, anyway i'll double check, if there are any implicit calls. Is there a way i can add a defensive check to allow calling complete, only if not already done. Something like isComplete() or any other way? Vicky On Tue, Nov 25, 2014 at 8:36