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

Closing executable JAR does not call ServletContextListener.contextDestroyed()

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0
    • 2.1
    • tomcat7
    • None
    • 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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            olamy Olivier Lamy
            nurkiewicz Tomasz Nurkiewicz
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment