https://bz.apache.org/bugzilla/show_bug.cgi?id=58638
Bug ID: 58638
Summary: tomcat looses asyn-supported when the configuration is
split between web.xml and anntotations
Product: Tomcat 8
Version: 8.0.26
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Catalina
Assignee: [email protected]
Reporter: [email protected]
I have an async servlet annotated like this:
@WebServlet(name = "streaming", urlPatterns = {"/streaming/*"})
And I'm trying to add CORS filter to it. Since it's third-party (I tried the
one bundled with tomcat, as well as a couple external filters), I have to add
it using web.xml:
<filter>
<filter-name>CorsFilter</filter-name>
<filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
<async-supported>true</async-supported>
</filter>
<filter-mapping>
<filter-name>CorsFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
But when I run this, I get the following exception:
23-Nov-2015 13:24:02.072 SEVERE [http-nio-8080-exec-2]
org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for
servlet [streaming] in context with path [/tuareg_1] threw exception
java.lang.IllegalStateException: A filter or servlet of the current chain does
not support asynchronous operations.
at org.apache.catalina.connector.Request.startAsync(Request.java:1611)
at org.apache.catalina.connector.Request.startAsync(Request.java:1604)
at
org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1030)
at ...
(N.B. The startAsync call is from the same thread, so this is not the problem)
I moved the servlet registration in the web.xml file (and removed the
annotation) and the whole thing worked.
I think that maybe tomcat doesn't merge the configration from web.xml and
annotations properly.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]