You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2015/11/23 12:37:26 UTC
[Bug 58638] New: tomcat looses asyn-supported when the configuration
is split between web.xml and anntotations
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: dev@tomcat.apache.org
Reporter: ivan@toshkov.org
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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 58638] tomcat looses asyn-supported when the configuration is
split between web.xml and anntotations
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58638
--- Comment #2 from Ivan Toshkov <iv...@toshkov.org> ---
Thank for the quick find and sorry for the noise. I accidentally removed the
flag from the annotation during a "minor" refactoring.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 58638] tomcat looses asyn-supported when the configuration is
split between web.xml and anntotations
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58638
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |INVALID
--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Your annotation doesn't specify that async is supported.
If required, further assistance is available from the users' mailing list.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org