5 Replies Latest reply on Jul 26, 2013 1:59 AM by ceiching

    Asynchronous Servlet: dispatching to jsp causes endless loop

    ceiching

      In JBoss 7.1.1.GA with JBossWeb 7.0.13.GA the dispatching of an asynchronous servlet request to a JSP causes and endless loop. This can be reproduced by installing the attached AsyncServletTest.war and executing the following link: http://localhost:8080/AsyncServletTest/AsyncServlet

       

      This results in an output similar to:

       

      15:34:27,966 INFO  [stdout] (http--127.0.0.1-8080-1) AsyncProcessor start: 1358433267966

      15:34:28,981 INFO  [stdout] (http--127.0.0.1-8080-1) AsyncProcessor end: 1358433268981

      15:34:28,981 INFO  [stdout] (http--127.0.0.1-8080-1) AsyncProcessor1 start: 1358433268981

      15:34:29,996 INFO  [stdout] (http--127.0.0.1-8080-1) AsyncProcessor1 end: 1358433269996

      15:34:29,996 INFO  [stdout] (http--127.0.0.1-8080-1) AsyncProcessor1 start: 1358433269996

      15:34:31,011 INFO  [stdout] (http--127.0.0.1-8080-1) AsyncProcessor1 end: 1358433271011

      15:34:31,011 INFO  [stdout] (http--127.0.0.1-8080-1) AsyncProcessor1 start: 1358433271011

      15:34:32,026 INFO  [stdout] (http--127.0.0.1-8080-1) AsyncProcessor1 end: 1358433272026

      15:34:32,026 INFO  [stdout] (http--127.0.0.1-8080-1) AsyncProcessor1 start: 1358433272026

      15:34:33,041 INFO  [stdout] (http--127.0.0.1-8080-1) AsyncProcessor1 end: 1358433273041

      15:34:33,041 INFO  [stdout] (http--127.0.0.1-8080-1) AsyncProcessor1 start: 1358433273041

      15:34:34,056 INFO  [stdout] (http--127.0.0.1-8080-1) AsyncProcessor1 end: 1358433274056

      15:34:34,056 INFO  [stdout] (http--127.0.0.1-8080-1) AsyncProcessor1 start: 1358433274056

      15:34:35,071 INFO  [stdout] (http--127.0.0.1-8080-1) AsyncProcessor1 end: 1358433275071

      ...

       

      This only happens when dispatching to a JSP (line 60):

       

      10 AsyncContext ac = ...

      20 System.out.println("AsyncProcessor1 start: " + System.currentTimeMillis());

      30 ServletRequest req = ac.getRequest();

      40 // do something    

      50 req.setAttribute("result", result);

      60 ac.dispatch("/result.jsp");

      70 System.out.println("AsyncProcessor1 end: " + System.currentTimeMillis());

       

      Any clues why this happens?