Thanks for replying,

1. I do not have any filters configured.
2. Yes my web.xml does mark themselves as adhering to the Sevlet 3.0
specification
3. Yes apps under http://localhost:8080/examples/jsp/ also does NOT work,
they also throw up the same exception.

Here is the stack trace

java.lang.IllegalStateException: Not supported.
    at org.apache.catalina.connector.Request.startAsync(Request.java:1664)
    at
org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1030)
    at
javax.servlet.ServletRequestWrapper.startAsync(ServletRequestWrapper.java:379)
    at test.comet.NewServlet.processRequest(NewServlet.java:75)
    at test.comet.NewServlet.doGet(NewServlet.java:98)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
    at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
    at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
    at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
    at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
    at
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1812)
    at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)


web.xml complete contents:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee";
xmlns:j2ee="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";>
    <servlet>
        <servlet-name>NewServlet</servlet-name>
        <servlet-class>test.comet.NewServlet</servlet-class>
        <async-supported>true</async-supported>
    </servlet>
    <servlet-mapping>
        <servlet-name>NewServlet</servlet-name>
        <url-pattern>/NewServlet</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
</web-app>




On Mon, May 14, 2012 at 4:55 PM, Konstantin Kolinko
<knst.koli...@gmail.com>wrote:

> 2012/5/14 rohit patil <sparkb...@gmail.com>:
> > Hi All,
> > I have written the below piece of code (NewServlet.java) to try the
> Servlet
> > 3.0 async feature.
> > But it is failing by throwing up the below mentioned error.
> >
> > Tomcat Version: 7.0.27 (32 bit)
> > OS: Windows 7
> >
> > java.lang.IllegalStateException: Not supported.
> >    at org.apache.catalina.connector.Request.startAsync(Request.java:1664)
> >    at
> >
> org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1030)
> >    at
> >
> javax.servlet.ServletRequestWrapper.startAsync(ServletRequestWrapper.java:379)
> >
> > code snippet:
> >   try{
> >            boolean asynSupported = request.isAsyncSupported();
> >            System.out.println("asynSupported: "+asynSupported);
> >            AsyncContext async = request.startAsync(request,
> > response);   *//exception
> > is thrown at this point
> > *            messageSender.addConnection(async);
> >            AlertListener alertListener = new
> AlertListener(messageSender);
> >            async.start(alertListener);
> >
> >        } catch (Throwable thr){
> >            thr.printStackTrace();
> >        }
> >
> > web.xml snippet:
> >
> >    <servlet>
> >        <servlet-name>NewServlet</servlet-name>
> >
> > <servlet-class>sample.comet.NewServlet</servlet-class>
> >        <async-supported>true</async-supported>
> >    </servlet>
>
>
> 1. You must have the same setting for all all filters in your request
> processing chain.
>
> Your stacktrace from IllegalStateException should have mentioned them.
>
> All the valves in the chain should also support async processing (that
> is declared programmatically, via Valve.isAsyncSupported() ).
>
> 2. Your web.xml (and conf/web.xml) should mark themselves as adhering
> to the Sevlet 3.0 specification (with version and probably with
> xsi:schemaLocation attributes on the root element).
>
> > server.xml snippet :
> >
> > <Connector connectionTimeout="20000" port="8084"
> > protocol="org.apache.coyote.http11.Http11NioProtocol"
> redirectPort="8443"/>
> >
> > Even the sample program "AsyncRequest" that comes with tomcat does not
> > work. :-(   it also throws the same exception.
>
> You mean those listed at the bottom of the following page:
> http://localhost:8080/examples/jsp/
>
> I've just tested and those examples work with Nio connector in 7.0.27.
> I am on WinXP.
>
> 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