The request associated with the AsyncContext has already completed processing
Some time ago there was a problem with the servlet3.0, is in servlet in asynchronous processing data, due to time outs, dry method terminates, but the back throws, anomalies are as follows:
java.lang.IllegalStateException: The request associated with the AsyncContext has already completed processing.
at org.apache.catalina.core.AsyncContextImpl.check(AsyncContextImpl.java:)
at org.apache.catalina.core.AsyncContextImpl.getResponse(AsyncContextImpl.java:)
Appeared and the reason for this is because asynchronous processing time servlet the default is 10 seconds, apparently because the data is too large, resulting in time out.
The solution is simple only in the doPost method of servlet add a sentence
asyncContext.setTimeout();
For asynchronous loading manual setting the timeout can be, 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 will not be blocked, but directly to the execution
//Business processing after the completion of the response by the AsyncContext management
AsyncContext asyncContext = request.startAsync();
asyncContext.setTimeout(900000000);
ProductHandleThread productHandleThread = new ProductHandleThread(asyncContext,request.getSession());
asyncContext.start(productHandleThread);
}
The request associated with the AsyncContext has already completed processing的更多相关文章
- Servlet 3特性:异步Servlet
解异步Servlet之前,让我们试着理解为什么需要它.假设我们有一个Servlet需要很多的时间来处理,类似下面的内容: LongRunningServlet.java package com.jou ...
- 关于webservlet 请求异步处理,链接未关闭出现的bug
webservlet +redis 的消息发布订阅 ,挺好的 当请求到来,向redis server申请一个频道 ,然后等着另一端架设是B 处理完毕获得到处理信息调用redis ,使用redis 往 ...
- springmvc webservlet 异步请求总结
1:每次请求会启动一个新线程 上边在debug状态下, 每次请求一次,生成一个新的 thread 在此已经是245了 出现一个现象在debug模式下, 每次请求生成的线程,自动在红框那个位置停了下来 ...
- 千万不要把Request传递到异步线程里面!有坑!
你好哇,我是歪歪. 前几天在网上冲浪的时候看到一篇技术文章,讲的是他把一个 request 请求传递到了线程池里面,然后遇到了一个匪夷所思的情况. 他写了这篇文章,把自己针对这个问题的探索过程分享了出 ...
- springmvc中request的线程安全问题
SpringMvc学习心得(四)springmvc中request的线程安全问题 标签: springspring mvc框架线程安全 2016-03-19 11:25 611人阅读 评论(1) 收藏 ...
- arcgis server "System.Web.Services.Protocols.SoapException: Error processing server request".
在 Arcgis Server 10中创建第一个程序,运行的时候就报错:System.Web.Services.Protocols.SoapException: Error processing se ...
- Servlet3.0新特性
1 Servlet3.0新特性概述 使用要求:MyEclipse10.0或以上版本,发布到Tomcat7.0或以上版本,创建JavaEE6.0应用! Servlete3.0的主要新特性如下三部分: 使 ...
- 你的响应阻塞了没有?--Spring-WebFlux源码分析
1. Spring WebFlux是什么? Spring WebFlux是Spring Framework 5.0中引入的新的反应式Web框架. 与Spring MVC不同,它不需要Servlet A ...
- 十八、泛型 l 注解 l Servlet3.0 l 动态代理 l 类加载器基础加强
l 泛型 l 注解 l Servlet3.0 l 动态代理 l 类加载器 泛型 1 回顾泛型类 泛型类:具有一个或多个泛型变量的类被称之为泛型类. public class A<T> { ...
随机推荐
- Memcached存储机制
Memcached存储机制 memcached 内存管理 分析(转) 缓存.缓存算法和缓存框架简介 memcached全面剖析–PDF总结篇
- Node.js之接收前台数据实例
<form class="form-horizontal" method="post" action="http:127.0.0.1:3000/ ...
- Windows 下 绿化 Oracle
既然Oracle在非windows平台上可以很“绿色”的执行,那么在windows平台上有无可能呢? 答案是“Yes-No” 基本上,除了监听器(lisentner)这个异类外,Oracle实例完全可 ...
- sql产生随机时间
--建立过程 CREATE PROCEDURE GetTime @BeginTime VARCHAR(5), @EndTime VARCHAR(5), @RandTime VA ...
- spring aop的配置
http://www.cnblogs.com/oumyye/p/4480196.html http://blog.csdn.net/hjm4702192/article/details/1727766 ...
- python--面向对象--14
原创博文,转载请标明出处--周学伟http://www.cnblogs.com/zxouxuewei/ Python 面向对象 Python从设计之初就已经是一门面向对象的语言,正因为如此,在Pyth ...
- [Object Tracking] Identify and Track Specific Object
Abstract—Augmented Reality (AR) has become increasingly popular in recent years and it has a widespr ...
- 定时器Enable Disable控制
问题:定时器如何控制它一会可用一会不可用,根据某个业务需求,比如:一个控制台程序扫描表中某个条件的数据,处理数据,控制台分布式部署,当主机宕机后,从机扫描定时器需要可用,当主机复活后,从机的扫描定时器 ...
- orcle时间
Oracle计算时间差函数 两个Date类型字段:START_DATE,END_DATE,计算这两个日期的时间差 (分别以天,小时,分钟,秒,毫秒): 天: ROUND(TO_NUMBER(END_D ...
- [AX]AX2012 R2 采购订单的“Request change”
在采购订单List或者Detail窗口的操作面板上有一个叫做“Request change”的按钮,如果这个按钮是激活的,采购订单不能直接编辑,而必须先使用这个按钮请求修改后,采购订单才能进入编辑状态 ...