I want to clarify the situation with a simpler example.

I have created a war with 2 servlets, without a web.xml. So war contains
only 2 classes (for each servlet).

One servlet is annotated as:
@WebServlet(value = "/async", asyncSupported = true)

Other is annotated as:
@WebServlet(value = "/sync")

Both overrides the service method with this code:
resp.getWriter().print("async=" + req.isAsyncSupported());

I am deploying this to Tomcat 7.0.21 running on JDK 1.6.0_27 on Linux
(ubuntu 10.04 x32) with APR connector.

When I call /sync and /async, both of them displays async=false

Mete

On Fri, Oct 14, 2011 at 1:43 PM, Mete BALCI <meteba...@gmail.com> wrote:

> web.xml root is:
> <web-app xmlns="http://java.sun.com/xml/ns/javaee";
>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd";
>       version="3.0">
>
> I tried mapping both with annotation and web.xml. Annotation itself works,
> I can use it without async, but isAsyncSupported returns false (both with
> annotation and web.xml mapping) so I cannot startAsync (raises IllegalState)
>
> Mete
>
> On Fri, Oct 14, 2011 at 1:38 PM, Konstantin Kolinko <
> knst.koli...@gmail.com> wrote:
>
>> 2011/10/14 Mete BALCI <meteba...@gmail.com>:
>> > Hello,
>> >
>> > I am trying to use Servlet 3 async support in Tomcat 7.0.21. I tried
>> setting
>> > annotation asyncSupported=true and writing this to web.xml, tried using
>> apr
>> > and nio, still getting false from isAsyncSupported, what am I missing ?
>> >
>> > Mete
>> >
>> > PS: There is no filter, just a single servlet overriding doPost, marked
>> > with @WebServlet(asyncSupported = true, urlPatterns = {"/2/*"})
>>
>> What is at the top of your web.xml? Is it using 3.0 version of schema?
>> Compare it with the examples webapp.
>>
>> If the servlet mapped using the annotation, or it is explicitly mapped
>> in web.xml?
>>
>> Best regards,
>> Konstantin Kolinko
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
>

Reply via email to