[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: NPE in DeployersImpl

alesj do-not-reply at jboss.com
Tue Sep 16 07:55:06 EDT 2008


It looks like some sort of synch issue:

  |       if (deploy != null && deploy.isEmpty() == false)
  |       {
  |          // Create the controller contexts
  |          for (DeploymentContext context : deploy)
  |          {
  |             checkShutdown();
  | 
  |             DeploymentControllerContext deploymentControllerContext = new DeploymentControllerContext(context, this);
  | (A)       context.getTransientAttachments().addAttachment(ControllerContext.class, deploymentControllerContext);
  |             try
  |             {
  |                controller.install(deploymentControllerContext);
  |                context.setState(DeploymentState.DEPLOYING);
  |                log.debug("Deploying " + context.getName());
  |                if (scopeBuilder != null)
  |                   context.getTransientAttachments().addAttachment(ScopeBuilder.class, scopeBuilder);
  |                if (repository != null)
  |                   context.getTransientAttachments().addAttachment(MutableMetaDataRepository.class, repository);
  |             }
  |             catch (Throwable t)
  |             {
  |                // Set the error on the parent
  |                context.setState(DeploymentState.ERROR);
  |                context.setProblem(t);
  |                // Set the children to not deployed
  |                setState(context, DeploymentState.UNDEPLOYED, DeploymentState.DEPLOYING);
  |             }
  |          }
  | 
  |          // Go through the states in order
  |          ControllerStateModel states = controller.getStates();
  |          for (ControllerState state : states)
  |          {
  |             for (DeploymentContext context : deploy)
  |             {
  |                DeploymentControllerContext deploymentControllerContext = context.getTransientAttachments().getAttachment(ControllerContext.class.getName(), DeploymentControllerContext.class);
  | (B)           ControllerState current = deploymentControllerContext.getState();
  | 
The last line here is the 621 line in DeployerImpl.

It looks like some other process 'cleaned' out the context between from (A) to (B) marks.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4176757#4176757

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4176757



More information about the jboss-dev-forums mailing list