glassfish
  1. glassfish
  2. GLASSFISH-15353

component id is not unregistered from ComponentEnvManager when WebApplication.start throws exception

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 3.1_b33
    • Fix Version/s: 3.1_b37
    • Component/s: web_container
    • Labels:
      None

      Description

      While debugging the weired NPE reported in GLASSFISH-15225, I found that the root cause of the NPE is a corrupt component environment manager. Looking at the code, I see that ComponentEnvManager.bindToComponentNamespace() is called by web container when Lifecycle.START_EVENT event is fired by StandardContext.start() method. During subsequent start up sequence when com.sun.enterprise.web.WebApplication.start() tries to load the web module, if an exception occurs then then deployment is simply aborted without unbindFromComponentNamespace() being called. This not only leads to memory leak, as the reference to old application is still there in the component env manager, if you try to redeploy the app, server starts using the old object and gets into all kinds of issues.

        Issue Links

          Activity

          Hide
          Shing Wai Chan added a comment -

          How bad is its impact? (Severity)
          medium

          How often does it happen? Will many users see this problem? (Frequency)
          So far, this occurs in some wars deployed as osgi bundle.

          How much effort is required to fix it? (Cost)
          low

          What is the risk of fixing it and how will the risk be mitigated? (Risk)
          low

          Show
          Shing Wai Chan added a comment - How bad is its impact? (Severity) medium How often does it happen? Will many users see this problem? (Frequency) So far, this occurs in some wars deployed as osgi bundle. How much effort is required to fix it? (Cost) low What is the risk of fixing it and how will the risk be mitigated? (Risk) low
          Hide
          Sanjeeb Sahoo added a comment -

          I don't agree with the assessment that this issue only occurs when some wars deployed as osgi bundles. My understanding of the code is that it is possible for this bug to affect plain vanilla war deployment that throws some runtime exceptions in loading phase.

          Show
          Sanjeeb Sahoo added a comment - I don't agree with the assessment that this issue only occurs when some wars deployed as osgi bundles. My understanding of the code is that it is possible for this bug to affect plain vanilla war deployment that throws some runtime exceptions in loading phase.
          Hide
          Chris Kasso added a comment -

          Approved for 3.1

          Show
          Chris Kasso added a comment - Approved for 3.1
          Hide
          Shing Wai Chan added a comment -

          I don't mean this "only" occurs for osgi bundles.
          The proposal fix would be to cleanup the naming information whenever there is any error in StandardContext.start().

          Show
          Shing Wai Chan added a comment - I don't mean this "only" occurs for osgi bundles. The proposal fix would be to cleanup the naming information whenever there is any error in StandardContext.start().
          Hide
          Shing Wai Chan added a comment -

          Sending web-core/src/main/java/org/apache/catalina/core/StandardContext.java
          Sending web-glue/src/main/java/com/sun/enterprise/web/WebModuleContextConfig.java
          Transmitting file data ..
          Committed revision 44285.

          Show
          Shing Wai Chan added a comment - Sending web-core/src/main/java/org/apache/catalina/core/StandardContext.java Sending web-glue/src/main/java/com/sun/enterprise/web/WebModuleContextConfig.java Transmitting file data .. Committed revision 44285.

            People

            • Assignee:
              Shing Wai Chan
              Reporter:
              Sanjeeb Sahoo
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: