Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-1569

NPE when executing a full-replace-deployment operation followed by an add operation for the same deployment

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 3.0.0.Alpha8
    • None
    • Management
    • None
    • Hide

      The attached project can be used to show the NullPointerException. It can be executed with the profile -Pexecute or by starting a default domain server and using the executable jar.

      Run from maven
      mvn clean package -Pexecute
      
      Run from command line
      mvn clean package
      java -jar issue-reproducer.jar
      
      Show
      The attached project can be used to show the NullPointerException . It can be executed with the profile -Pexecute or by starting a default domain server and using the executable jar. Run from maven mvn clean package -Pexecute Run from command line mvn clean package java -jar issue-reproducer.jar

      Executing the full-replace-deployment operation on a domain deployment works correctly if it's a single operation (even in a composite operation). In a composite operation where an add operation is executed to add the deployment to a server-group(s) after the full-replace-deployment an NPE is thrown because the previous resource is null since it did not exist.

      org.jboss.as.server.deployment.DeploymentFullReplaceHandler
      // WFCORE-495 remove and call context.addResource() as below to add new resource with updated PERSISTENT value
      final ModelNode deploymentModel = context.removeResource(PathAddress.pathAddress(deploymentPath)).getModel();
      

      The context.removeResource() returns null since the deployment was not deployed on the server in the server-group.

      From debugging it looks like the full composite operation is passed to each server in a server group. For obvious reasons if the add operation is done before the full-replace-deployment operation the composite operation is successful.

      The easy workaround is just to ignore missing deployments in the org.jboss.as.server.deployment.DeploymentFullReplaceHandler OSH and log a debug or trace message indicating it was skipped because the deployment did not previously exist on the server. However this may need to be done at the HC operation routing level.

              chaowan@redhat.com Chao Wang
              jperkins-rhn James Perkins
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: