You recursively invoke startAsync unlimitedly. 2010/11/9 Ben Xiong <xpsl...@gmail.com>
> ?Another case: > > Web.xml > <?xml version="1.0" encoding="UTF-8"?> > <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web=" > http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" > xsi:schemaLocation="http://java.sun.com/xml/ns/javaee > http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" > id="WebApp_ID" version="3.0"> > <display-name>TomcatComet</display-name> > <servlet> > <servlet-name>s3</servlet-name> > <servlet-class>comet.Servlet3</servlet-class> > <async-supported>true</async-supported> > </servlet> > <servlet-mapping> > <servlet-name>s3</servlet-name> > <url-pattern>/s3</url-pattern> > </servlet-mapping> > </web-app> > > comet.Servlet3 source code: > > package comet; > > import javax.servlet.http.HttpServlet; > import javax.servlet.http.HttpServletRequest; > import javax.servlet.http.HttpServletResponse; > > public class Servlet3 extends HttpServlet { > > public void doGet(HttpServletRequest req, HttpServletResponse res) { > req.startAsync(req, res); > System.out.println("=============Finally, it works! > ===================="); > } > } > > Server startup log: > > INFO: SessionListener: contextInitialized() > Nov 9, 2010 2:24:13 PM org.apache.catalina.startup.HostConfig > deployDirectory > > INFO: Deploying web application directory host-manager > Nov 9, 2010 2:24:13 PM org.apache.catalina.startup.HostConfig > deployDirectory > > INFO: Deploying web application directory manager > Nov 9, 2010 2:24:13 PM org.apache.catalina.startup.HostConfig > deployDirectory > > INFO: Deploying web application directory ROOT > Nov 9, 2010 2:24:13 PM org.apache.coyote.http11.Http11NioProtocol start > > INFO: Starting Coyote HTTP/1.1 on http-8080 > Nov 9, 2010 2:24:14 PM org.apache.coyote.ajp.AjpAprProtocol start > > INFO: Starting Coyote AJP/1.3 on ajp-8009 > Nov 9, 2010 2:24:14 PM org.apache.catalina.startup.Catalina start > INFO: Server startup in 1586 ms > > URL: http://localhost:8080/TomcatComet/s3 > > Exception: > > INFO: Server startup in 1586 ms > Nov 9, 2010 2:24:50 PM > org.apache.tomcat.util.net.NioEndpoint$SocketProcessor run > SEVERE: > java.lang.StackOverflowError > at > org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1031) > at > org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1031) > at > org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1031) > at > org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1031) > at > org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1031) > at > org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1031) > at > org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1031) > at > org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1031) > ...... > > Same Win 7 64 bit, native connecter, tomcat 7.0.4, :( > >