Bug 49635

Summary: org.apache.catalina.connector.RequestFacade has wrong implementation...
Product: Tomcat 7 Reporter: shoichi mazda <den04304>
Component: ConnectorsAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: P2    
Version: 7.0.0   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description shoichi mazda 2010-07-21 23:58:10 UTC
I can't run a below code.

@WebServlet(urlPatterns={"/async"}, asyncSupported=true)
public class AsyncServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		AsyncContext context = request.startAsync(request, response);
		
		context.start(new Runnable() {
			@Override
			public void run() {
				System.out.println("async!!");
			}
		});
	}
}

It occur java.lang.StackOverflowError.

java.lang.StackOverflowError
	at org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:963)
	at org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:963)
	at org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:963)
.
.
.

So, I think that org.apache.catalina.connector.RequestFacade has wrong implementation.I show part of source code in RequestFacade line number is 961 to 964.

public AsyncContext startAsync(ServletRequest request, ServletResponse response)
    throws IllegalStateException {
    return request.startAsync(request, response);
}

I think it should have "this." before "request" next "return".
Comment 1 Mark Thomas 2010-07-22 02:08:44 UTC
The analysis is wrong but there is an issue. The root cause is the same as the duplicate where a fix is currently being worked on.

*** This bug has been marked as a duplicate of bug 49567 ***