Some time ago There was a problem with the servlet3.0, are in Servlets in asynchronous processing data, due to time outs, Dr Y method terminates, but the back throws, anomalies is as follows:
Java.lang.IllegalStateException:The request associated with the Asynccontext have already completed processing. At Org.apache.catalina.core.AsyncContextImpl.check (Asynccontextimpl.java:521) at Org.apache.catalina.core.AsyncContextImpl.getResponse (Asynccontextimpl.java:245)
Appeared and the reason for this was because asynchronous processing time servlet The default is ten seconds, apparently Bec Ause the data is too large, resulting.
The solution is simple only in the DoPost method of the servlet add a sentence
Asynccontext.settimeout (900000000);
For asynchronous loading manual Setting the timeout can is, all the code as follows:
public void DoPost (HttpServletRequest request, httpservletresponse response) throws Servletexception, IOException { request.setcharacterencoding ("UTF-8"); Response.setcontenttype (Getservletcontext (). Getinitparameter ("content");//in asynchronous mode, call the business Processing threads to process business //servlet is not being blocked, but directly to the execution //business Pro Cessing after the completion of the response by the Asynccontext management asynccontext asynccontext = Request.starta Sync (); Asynccontext.settimeout (900000000); Producthandlethread producthandlethread = new Producthandlethread (Asynccontext,request.getsession ()); Asynccontext.start (Producthandlethread);}
The request associated with the Asynccontext have already completed processing