springMVC项目异步处理请求的错误Async support must be enabled on a servlet and for all filters involved in async


从github上down下来一个项目,springMVC-chat。作者全是用的注解,也就是零配置。

这可苦了我,经过千辛万苦,最终集成到现在的项目中有一点样子了,结果报出来下面的错误。红色部分。解决方法为,在web.xml中也就是springMVC的总配置文件中加上一句话:

<async-supported>true</async-supported>

这句话的位置一定要放正确,否则,一切都是徒劳。至于配置spring异步支持(其实是配置servlet异步支持)的放置位置见下图。

五月 16, 2014 4:30:59 下午 org.apache.catalina.core.StandardWrapperValve invoke

严重: Servlet.service() for servlet [SpringMVC] in context with path [/ZHDM] threw exception [Request processing failed; nested exception is java.lang.IllegalStateException: Async support must be enabled on a servlet and for
all filters involved in async request processing. This is done in Java code using the Servlet API or by adding "<async-supported>true</async-supported>" to servlet and filter declarations in web.xml.] with root cause

java.lang.IllegalStateException: Async support must be enabled on a servlet and for all filters involved in async request processing. This is done in Java code using the Servlet API or by adding "<async-supported>true</async-supported>" to servlet and filter
declarations in web.xml.

at org.springframework.util.Assert.state(Assert.java:385)

at org.springframework.web.context.request.async.StandardServletAsyncWebRequest.startAsync(StandardServletAsyncWebRequest.java:104)

at org.springframework.web.context.request.async.WebAsyncManager.startAsyncProcessing(WebAsyncManager.java:431)

at org.springframework.web.context.request.async.WebAsyncManager.startDeferredResultProcessing(WebAsyncManager.java:409)

at org.springframework.web.servlet.mvc.method.annotation.DeferredResultMethodReturnValueHandler.handleReturnValue(DeferredResultMethodReturnValueHandler.java:51)

at org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:71)

at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:122)

at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749)

at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:690)

at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)

at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945)

at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876)

at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)

at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:618)

at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:301)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:136)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:74)

at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:516)

at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1015)

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:652)

at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:277)

at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2451)

at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2440)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at java.lang.Thread.run(Thread.java:744)

springMVC项目异步处理请求的错误Async support must be enabled on a servlet and for all filters involved in async,布布扣,bubuko.com

时间: 2024-09-29 20:51:23

springMVC项目异步处理请求的错误Async support must be enabled on a servlet and for all filters involved in async的相关文章

springMVC项目异步错误处理请求Async support must be enabled on a servlet and for all filters involved in async

离github在down下一个项目,springMVC-chat.总体上有标注.这就是零配置. 这可苦了我,费尽周折,最后整合到项目现在看起来有点.出来以下的错误.红色部分.解决方法为,在web.xml中也就是springMVC的总配置文件里加上一句话: <async-supported>true</async-supported> 这句话的位置一定要放正确,否则.一切都是徒劳.至于配置spring异步支持(事实上是配置servlet异步支持)的放置位置见下图. watermark

已解决: idea创建并部署SpringMVC项目时 报错 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

用IDEA创建并运行SpringMVC项目时,最初发现没有Servlet包,这个问题已在上篇解决,然而当我们尝试去运行此时的SpringMVC项目时,发现仍然有错误.ClassNotFoundException 笔者也是IDEA的新手,在网上查了很多资料 有帖子说是Tomcat Server 的  VM options 没有填写,按照帖子填上这一项后,重启项目依然报错,最后终于找到了问题的原因,spring springmvc 的jar包没有导入.. 下面来解决这个问题: 现在问题解决了 原文地

C# .Net FrameWork3.5中异步HTTP请求时,由于安全协议的问题System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)方法抛出“基础连接已经关闭: 发送时发生错误”的解决办法

现象描述: C# .Net FrameWork3.5中异步HTTP请求时,由于安全协议的问题System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)方法抛出“基础连接已经关闭: 发送时发生错误”. 原因分析: 大多数情况下是由于客户端所设置的HTTP访问请求的安全协议不符合服务器端的安全协议要求.比如,NASA提供瓦片服务的http://worldwind25.arc.nasa.gov/wms?service=WMS&v

Eclipse运行Maven的SpringMVC项目Run on Server时出现错误:Error configuring application listener of class org.springframework.web.context.ContextLoaderListener的问题解决

错误: 严重: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener at org.apache.catalina.loader.WebappClassLoaderBase.

在JavaScript中使用json.js:Ajax项目之POST请求(异步)

经常在百度搜索框输入一部分关键词后,弹出候选关键热词.现在我们就用Ajax技术来实现这一功能. 一.下载json.js文件 百度搜一下,最好到json官网下载,安全起见. 并与新建的两个文件部署如图 json.js也可直接复制此处的代码获取. 1 /* 2 json.js 3 2008-03-14 4 5 Public Domain 6 7 No warranty expressed or implied. Use at your own risk. 8 9 This file has been

springmvc 配置异步请求

最开始按照网上配置了一个servlet class 没有继承Filter .结果报错.网上有文章说是tomcat 启动加载的servlet-3.0- api 加载了 tomcat 安装目录下lib里边的自带的 servlet api 与 环境中api冲突 改成 <groupId>javax.servlet</groupId><artifactId>javax.servlet-api</artifactId><version>3.0.1</v

myEclipse环境下配置springMvc项目,进行简单的请求

1."File-->New-->WebProject"新建一个web项目,命名为springMvc 2.将所需要用到的jar包复制到WEB-INF/lib路径下,然后右键项目,Build Path-->Configure Build Path,在Libraries选项卡中选择Add JARs,选中springMvc项目中WebContent/WEB-INF/lib下的jar包. 3.在WebContent根目录下新建MyJsp.jsp文件,code as: <%

SpringMvc项目中使用GoogleKaptcha 生成验证码

SpringMvc项目中使用GoogleKaptcha 生成验证码 前言:google captcha 是google生成验证码的一个工具类,其原理是将随机生成字符串保存到session中,同时以图片的形式返回给页面,之后前台页面提交到后台进行对比. 1.jar包准备 官方提供的pom应该是 <dependency> <groupId>com.google.code.kaptcha</groupId> <artifactId>kaptcha</arti

jQuery之异步Ajax请求使用

$.ajax({type:'',data:'',async:''...}) 参数: 1.cache: true缓存页面 false 不缓存页面 (默认: true,dataType为script和jsonp时默认为false) 1.type:  GET /POST 请求方式 ("POST" 或 "GET"), 默认为 "GET".注意:其它 HTTP 请求方法,如 PUT 和 DELETE 也可以使用,但仅部分浏览器支持. 2.async: tr