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> { ...
随机推荐
- java rpc
一.简介 Hessian和Burlap是由Caucho Technology提供的基于HTTP协议的轻量级远程服务解决方案.他们都致力于借助尽可能简单那的API和通信协议来简化Web服务. He ...
- 单例模式简介以及C++版本的实现
本篇博文主要内容参考 C++的单例模式一文,在此,为原作者耐心细致的分析讲解,表示感谢.本文将结合此篇文章,给出自己做实验后的理解以及代码,作为今天学习的小结. 单例模式,它的意图是保 ...
- svn管理码云项目
1.设置SVN管理项目 进入项目->管理 2.获取SVN地址 3.SVN添加项目.单击右键 -> 检出->版本库Url(这里填写svn地址)
- input框取消光标颜色手机端不生效
<style> input{ color:transparent; } </style> <input value="我要隐藏光标"> //文字 ...
- sql2008修改管理员与普通用户密码
方法一: sp_password Null,'123,'sa'把sa的密码设为“123” 执行成功后有“Command(s) completed successfully.” OK! 方法二: 第一步 ...
- Mongodb安全认证
Mongodb安全认证在单实例和副本集两种情况下不太一样,单实例相对简单,只要在启动时加上 --auth参数即可,但副本集则需要keyfile. 一.单实例 1.启动服务(先不要加auth参数) 2. ...
- HTML5标签canvas制作动画
摘要: canvas可以绘制图像,自然而然的就可以制作动画,因为动画的每一帧都是图像.我们可以利用javascript的setInterval函数来实现动画效果. 下面是一个例子,小圆绕着红点圆心不停 ...
- 【scala】 scala 基础(一)
至于什么是scala,摘录一段 维基百科的解释: scala 下载 安装 省略 1.环境变量配置完成后 命令行报错,因为scala 的安装路径里边包含空格 修改后即可.由于我的本地包含空格,此处CLI ...
- 用Eclipse编写Android程序的代码提示功能
用Eclipse编写Android程序的代码提示功能主要是在java和xml文件中,有时候会失效,默认的提示功能有限. 1)java文件自动提示 Window->Preferences- ...
- 8 -- 深入使用Spring -- 8...1 Spring提供的DAO支持
8.8.1 Spring提供的DAO支持. DAO模式是一种标准的Java EE设计模式,DAO模式的核心思想是,所有的数据库访问都通过DAO组件完成,DAO组件封装了数据库的增.删.查.改等原子操作 ...