asynchronous - How to set Async-Supported flag for the Filters which are getting called via Spring DelegatingFilterProxy chain? -
i developing servlet support async operation. servlet called via multiple filters. of filters part of filterproxychain created via delegatingfilterproxy.
if have start async context servlet, filter chain should support async operation. else below exception gets thrown -
28-jul-2017 09:41:51.196 severe [http-nio-127.0.0.1-7441-exec-2] org.apache.catalina.core.standardwrappervalve.invoke servlet.service() servlet [eventbus] in context path [] threw exception java.lang.illegalstateexception: filter or servlet of current chain not support asynchronous operations. @ org.apache.catalina.connector.request.startasync(request.java:1630) @ org.apache.catalina.connector.request.startasync(request.java:1623) @ org.apache.catalina.connector.requestfacade.startasync(requestfacade.java:1030) @ javax.servlet.servletrequestwrapper.startasync(servletrequestwrapper.java:379) @ javax.servlet.servletrequestwrapper.startasync(servletrequestwrapper.java:379) @ org.springframework.security.web.servletapi.httpservlet3requestfactory$servlet3securitycontextholderawarerequestwrapper.startasync(httpservlet3requestfactory.java:167) @ com.amdocs.vshield.vsm.asyncrest.vsmasyncrestcontroller.doget(vsmasyncrestcontroller.java:89) @ javax.servlet.http.httpservlet.service(httpservlet.java:622) @ javax.servlet.http.httpservlet.service(httpservlet.java:729) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:292) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:207)
some of filters called via delegatingfilterproxy not configured in web.xml explicitly. how make these filters support async ?
so:
- spring security version must @ least 3.2
web.xml
'swebapp
element must haveversion="3.0"
- your
delegatingfilterproxy
<filter>
element must have<async-supported>true</async-supported>
- its mapping should have following:
<dispatcher>request</dispatcher> <dispatcher>async</dispatcher>
Comments
Post a Comment