https://bz.apache.org/bugzilla/show_bug.cgi?id=60385

            Bug ID: 60385
           Summary: ServletRequestListener.requestDestroyed not invoked
                    after exception in requestInitialized
           Product: Tomcat 7
           Version: 7.0.35
          Hardware: Macintosh
                OS: Mac OS X 10.1
            Status: NEW
          Severity: major
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: tow...@newrelic.com
  Target Milestone: ---

Created attachment 34456
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34456&action=edit
Builds a WAR that reproduces the issue

If an application has a ServletRequestListener defined that throws an exception
from its requestInitialized() method, it will prevent the requestDestroyed()
method from ever being invoked for that request. This causes major problems
when a framework relies on requestInitialized and requestDestroyed always being
called at least once for every request.



Steps to Reproduce:

1) Build the attached project which generates a WAR

2) Deploy the WAR to Tomcat

3) Visit the /tomcat-listener-bug-1.0/simple page 6 times. On the 6th request
the application will shut down if requestDestroyed() is never called



Actual Results:

The application shuts down.


Expected Results:

The application should stay up and requestDestroyed() should be called for
every call to requestInitialized().




Build Date & Hardware:

Originally tested on Tomcat 7.0.35, Mac OS X 10.1 and Java 7. The issue occurs
on all versions of Tomcat (even up to 9.0.0.M13) and all versions of Java as
well.




Additional Builds and Platforms:

I tested this same sample app on Jetty 9 and Glassfish 4 (newest releases of
both as of 11/16/2016) and it does not exhibit this same behavior. On both of
those servers requestDestroyed() is called for every single
requestInitialized(), even in the case of an exception.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to