glassfish
  1. glassfish
  2. GLASSFISH-18263

Need to unpublish EJB global JNDI names after failed partial deployment

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 4.0
    • Component/s: ejb_container
    • Labels:
      None

      Description

      NameAlreadyBoundException after a failed deploy of test ejb31/full/jcdifull

      I was able to reproduce it with trunk build, too. When deploying with a non-existent cdi interceptor class, it failed as expected. Nothing's deployed so far. But the failed deploy didn't clean up jndi names already registered. After correcting the class name, the 2nd deploy still failed due to the naming conflict with the left-over names.

      Since ejb deployer executed before weld deployer, all the jndi registration already happens when weld detects errors.

      During the cleanup after partial deployment, ejb deployer.unload is invoked, which unbinds component env entries. See EngineRef.unload

      public boolean unload(ExtendedDeploymentContext context) {...
              // then remove the application from the container
              Deployer deployer = ctrInfo.getDeployer();
              try {
                  deployer.unload(appCtr, context);
                  ctrInfo.unload(context);
      ...
      

      Currently the global jndi unpublishing happens in BaseContainer.undeploy, which can be reached from EjbApplication.stop. So any failure within ejb module is handled correctly.

        Activity

        Hide
        Cheng Fang added a comment -

        Committed revision 52367. to trunk.

        Show
        Cheng Fang added a comment - Committed revision 52367. to trunk.

          People

          • Assignee:
            Cheng Fang
            Reporter:
            Cheng Fang
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: