1 Reply Latest reply on Jun 18, 2008 8:38 AM by alesj

    Wrong position of DeploymentControllerContext addition

    alesj

      There is a bug in DeployersImpl::process. :-)

      The position of where we add DeploymentControllerContext is wrong.
      Or we don't do enough checks.

       controller.install(deploymentControllerContext);
       context.setState(DeploymentState.DEPLOYING);
       log.debug("Deploying " + context.getName());
       context.getTransientAttachments().addAttachment(ControllerContext.class, deploymentControllerContext);
      

      After controller::install.
      But what if it fails there?
      So this is then null:
       DeploymentControllerContext deploymentControllerContext = context.getTransientAttachments().getAttachment(ControllerContext.class.getName(), DeploymentControllerContext.class);
       ControllerState current = deploymentControllerContext.getState();
      


      Should we move that addition before controller::install.
      Or add additional check if DCC is not null?

        • 1. Re: Wrong position of DeploymentControllerContext addition
          alesj

          I moved it up, before install:

          + context.getTransientAttachments().addAttachment(ControllerContext.class, deploymentControllerContext);
           try
           {
           controller.install(deploymentControllerContext);
           context.setState(DeploymentState.DEPLOYING);
           log.debug("Deploying " + context.getName());
          - context.getTransientAttachments().addAttachment(ControllerContext.class, deploymentControllerContext);