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

Carlos,

I wonder if the runtime-name is different then the name of the EAR? In which case the redeploy action would probably not occur. This seems like it might be a bug. I suggest that you follow up with support if you want to investigate this issue further.

An option to get around the problem would be to use an execute-script action which could instead attempt to undeploy before a deployment is attempted. This of course would require you to include a jboss-cli script within the bundle that would perform the undeploy and then deploy.

Hi Larry,

As you mentioned seems like a bug. I tried by setting the runtime-name the same as the name of the EAR and it worked!

Maybe you could open a bug report with support so they can follow this issue.

Regards Carlos

Carlos,

I captured this in Bug 1503826 - Bundle deployment using deployment handover action fails to properly replace/upgrade existing deployment if deployment runtime-name is not the same as deployment name.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.