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 ?

here here: https://spring.io/blog/2012/12/17/spring-security-3-2-m1-highlights-servlet-3-api-support/#servlet3-async

so:

  1. spring security version must @ least 3.2
  2. web.xml's webapp element must have version="3.0"
  3. your delegatingfilterproxy <filter> element must have <async-supported>true</async-supported>
  4. its mapping should have following:

<dispatcher>request</dispatcher> <dispatcher>async</dispatcher>


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -