Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet 3.0 startAsync + http pipeline

 
kunal ekawde
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?


~Kunal
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic