File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes servlet 3.0 startAsync + http pipeline Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet 3.0 startAsync + http pipeline" Watch "servlet 3.0 startAsync + http pipeline" New topic

servlet 3.0 startAsync + http pipeline

kunal ekawde

Joined: Dec 08, 2009
Posts: 1
I tried with servlet 3.0 on latest Glassfish v3.
On every GET, I start a Timer (5 sec) and on timer expiry call asyncCtx.complete().
It works fine with Req1-Rsp1 but doesn't seem to work on Req1,Req2 on same TCP connection (pipeline) and startAsync throws 'java.lang.IllegalStateException: startAsync already called' .

on doGET()

in run() for timer

As per startAsync:'Subsequent invocations of this method, or its overloaded variant, will return the same AsyncContext instance, reinitialized as appropriate. '

Is it expected behavior or I'm missing something?

I agree. Here's the link:
subject: servlet 3.0 startAsync + http pipeline
jQuery in Action, 3rd edition