Remove deployment with recipe

Latest response

Hi,

I'm able to deploy a bundle which deploys an EAR application on my JBoss EAP 6.4.16 Domain.

Now I'm trying to deploy a new version of the same bundle but I get the following message:

domain-failure-description={JBAS014653: Composite operation failed and was rolled back. Steps that failed:={Operation step-1=JBAS014803: Duplicate resource [("deployment" => "MyApp.ear")]}}}, rolled-back=true

If I delete the application through JBoss Console and later trying to deploy the new bundle version it works.

The problem is that I can't deploy a new bundle if the application is still deployed.

Is there a way to delete the previously deployed application with the new bundle's recipe?

My recipe:

<project name="capa-bundle" default="main" xmlns:rhq="antlib:org.rhq.bundle">
 <rhq:bundle name="MyApp" version="1.2" description="Bundle for MyApp">

  <rhq:input-property name="myapp.runtime.name" defaultValue="MyAppBundle.ear" required="true"/>
  <rhq:input-property name="myapp.serverGroup.name" defaultValue="clusterE-server-group" required="true"/>

  <rhq:deployment-unit name="example.com deployment unit" compliance="filesAndDirectories">

   <rhq:archive name="MyApp.ear">
    <rhq:handover action="deployment">
     <rhq:handover-param name="runtimeName" value="${myapp.runtime.name}"/>
     <rhq:handover-param name="serverGroup" value="${myapp.serverGroup.name}"/>
    </rhq:handover>
   </rhq:archive>
  </rhq:deployment-unit>
 </rhq:bundle>
 <target name="main"/>
</project>

By the way, my JON's version is 3.3

Regards
Carlos

Responses