I'm have some trouble working out what it is this bit of code in
NodeImpl.configureNode is trying to do:

       // Find the composite in the given contributions
       boolean found = false;
       Artifact compositeFile = contributionFactory.createArtifact();
       compositeFile.setUnresolved(true);
       compositeFile.setURI(composite.getURI());
       for (Contribution contribution: workspace.getContributions()) {
           ModelResolver resolver = contribution.getModelResolver();
//            for (Artifact artifact : contribution.getArtifacts()){
//                logger.log(Level.INFO,"artifact - " + artifact.getURI());
//            }
           Artifact resolvedArtifact = resolver.resolveModel(Artifact.class,
compositeFile);
           if (!resolvedArtifact.isUnresolved() &&
resolvedArtifact.getModel() instanceof Composite) {

               if (!composite.isUnresolved()) {

                   // The composite content was passed into the node and
read into a composite model,
                   // don't use the composite found in the contribution, use
that composite, but just resolve
                   // it within the context of the contribution
                   compositeProcessor.resolve(composite, resolver);

               } else {

                   // Use the resolved composite we've found in the
contribution
                   composite = (Composite)resolvedArtifact.getModel();
               }
               found = true;
               break;
           }
       }
       if (!found) {
           throw new IllegalArgumentException("Composite not found: " +
composite.getURI());
       }

The comments make it sounds like it should work when passing in the
composite content (using NodeFactory.createNode(uri, content,
contributions)) but it doesn't unless that passed in composite is also
included within one of the contributions. Thats not going to be the case if
you're passing in the composite content so it doesn't find it and throws the
IllegalArgumentException. I've commented out some of that code in r746244 to
show what makes the itest/distribution/webapp-helloworld-jsp itest work and
the build passes like this, but not understanding what that code is trying
to do I'm not sure what the correct fix is?

   ...ant

Reply via email to