Uploaded image for project: 'Apache Tomcat Maven Plugin'
  1. Apache Tomcat Maven Plugin
  2. MTOMCAT-186

Closing executable JAR does not call ServletContextListener.contextDestroyed()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.1
    • Component/s: tomcat7
    • Labels:
      None
    • Environment:
      Java 7, maven 3.0.3

      Description

      Executable JAR created by tomcat7-maven-plugin:exec-war-only does not call ServletContextListener.contextDestroyed() callback method when Java process is killed or when Ctrl + C is pressed. There is no way to cleanly shutdown web application.

      The same application (attached) deployed on standalone Tomcat works just fine. Hitting Ctrl + C correctly undeploys and shuts down application.

      Build attached application and run java -jar target/standalone.jar. Ctrl + C kills the process immediately. On the other hand {standalone.war}} deployed to normal Tomcat under /webapps shuts down correctly and we can see log statement from contextDestroyed().

        Attachments

        1. listener.zip
          29 kB
          Tomasz Nurkiewicz

          Activity

            People

            • Assignee:
              olamy Olivier Lamy (*$^¨%`£)
              Reporter:
              nurkiewicz Tomasz Nurkiewicz
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: