Bug 1389844

Summary: Error "Configure either handover or exploded" when exploded="false" is used in combination with rhq:handover
Product: [JBoss] JBoss Operations Network Reporter: Larry O'Leary <loleary>
Component: ProvisioningAssignee: Michael Burman <miburman>
Status: CLOSED WONTFIX QA Contact: Mike Foley <mfoley>
Severity: low Docs Contact:
Priority: unspecified    
Version: JON 3.3.7CC: fbrychta
Target Milestone: ---   
Target Release: JON 3.3.9   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-07-20 14:58:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Larry O'Leary 2016-10-28 21:38:04 UTC
Description of problem:
Bundle subsystem fails to parse bundle's deploy.xml if the rhq:archive task defines its exploded attribute with a value of "false" and has a child task of rhq:handover.

Version-Release number of selected component (if applicable):
3.3.7

How reproducible:
Always

Steps to Reproduce:
1. From the Bundles select _New_.
2. In step 1 of _Bundle Creation Wizard_ select _Recipe_ radio-button.
3. Paste the following recipe:
+
----
<?xml version="1.0"?>
<project name="helloworld-war-bundle" default="main" xmlns:rhq="antlib:org.rhq.bundle">
  <rhq:bundle name="helloworld-war-bundle" version="1.0" description="A sample bundle containing the jboss-helloworld.war from EAP 6 quickstarts">
    <rhq:deployment-unit name="helloworld-war" compliance="filesAndDirectories">
      <rhq:archive name="jboss-helloworld.war" exploded="false">
        <rhq:handover action="deployment">
          <rhq:handover-param name="runtimeName" value="jboss-helloworld" />
        </rhq:handover>
      </rhq:archive>
    </rhq:deployment-unit>
  </rhq:bundle>
  <target name="main" />
</project>
----
4. Select _Next_.

Actual results:
Bundle creation fails with the error "[1477690572690] java.lang.Exception:Failed to parse the bundle Ant script. -> org.apache.tools.ant.BuildException:Configure either handover or exploded" and the following is logged to server log
----
    WARN  [org.rhq.coregui.server.gwt.BundleGWTServiceImpl] (http-/0.0.0.0:7080-5) Sending exception to client: [1477689980645] : java.lang.Exception: Failed to parse the bundle Ant script.
        at org.rhq.enterprise.server.plugins.ant.AntBundleServerPluginComponent.parseRecipe(AntBundleServerPluginComponent.java:137)
        at org.rhq.enterprise.server.plugin.pc.bundle.BundleServerPluginManager.parseRecipe(BundleServerPluginManager.java:158) [rhq-server.jar:4.12.0.JON330GA-redhat-2]
        at org.rhq.enterprise.server.bundle.BundleManagerBean.createBundleVersionViaRecipeImpl(BundleManagerBean.java:721) [rhq-server.jar:4.12.0.JON330GA-redhat-2]
        at org.rhq.enterprise.server.bundle.BundleManagerBean.createBundleVersionViaRecipe(BundleManagerBean.java:706) [rhq-server.jar:4.12.0.JON330GA-redhat-2]
        ...
        at org.rhq.enterprise.server.bundle.BundleManagerLocal$$$view80.createBundleVersionViaRecipe(Unknown Source) [rhq-server.jar:4.12.0.JON330GA-redhat-2]
        at org.rhq.coregui.server.gwt.BundleGWTServiceImpl.createBundleVersionViaRecipe(BundleGWTServiceImpl.java:95) [classes:]
        ...
    Caused by: Configure either handover or exploded
        at org.rhq.bundle.ant.type.ArchiveType.ensureHandoverOrExplodedIsConfigured(ArchiveType.java:106)
        at org.rhq.bundle.ant.type.ArchiveType.addConfigured(ArchiveType.java:90)
        ...
        at org.rhq.bundle.ant.AntLauncher.preconfigureTask(AntLauncher.java:325)
        at org.rhq.bundle.ant.AntLauncher.validateAndPreprocess(AntLauncher.java:278)
        at org.rhq.bundle.ant.AntLauncher.parseBundleDeployFile(AntLauncher.java:177)
        at org.rhq.enterprise.server.plugins.ant.AntBundleServerPluginComponent.parseRecipe(AntBundleServerPluginComponent.java:122)
        ... 105 more
----

Expected results:
No failure and bundle creation continues.

Additional info:
From the documentation, it indicates that exploded must be set to false. However, it appears that if the attribute exploded is set, regardless of value, bundle creation fails.