Bug 917088 - [RHQ] Relative links when defining destinationFile in the deploy.xml are broken
Summary: [RHQ] Relative links when defining destinationFile in the deploy.xml are broken
Keywords:
Status: ON_QA
Alias: None
Product: RHQ Project
Classification: Other
Component: Provisioning
Version: 4.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-01 16:27 UTC by bkramer
Modified: 2022-03-31 04:27 UTC (History)
1 user (show)

Fixed In Version:
Clone Of: 917085
: 917085 (view as bug list)
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)
Contains agent.log and test bundle (5.65 KB, application/zip)
2013-03-01 16:27 UTC, bkramer
no flags Details

Description bkramer 2013-03-01 16:27:33 UTC
Created attachment 704239 [details]
Contains agent.log and test bundle

Description of problem:
If deploy.xml is using relative links for destinationFile for instance:


<project name="my-test-deployment" default="main" xmlns:rhq="antlib:org.rhq.bundle">
    <rhq:bundle name="myTest" version="1.1.1" description="first my-test deployment">
        <rhq:deployment-unit name="Datasource">
            <rhq:file name="app.properties" destinationFile="../../conf/app.properties" replace="false"/>
        </rhq:deployment-unit>
    </rhq:bundle>
    <target name="main"/>
</project>

bundle deployment will fail with the following exception:

2013-03-01 14:40:03,411 ERROR [ResourceContainer.invoker.nonDaemon-1] (org.rhq.plugins.ant.AntBundlePluginComponent)- Failed to deploy bundle [class org.rhq.core.pluginapi.bundle.BundleDeployRequest: deployment=[BundleResourceDeployment: bdd=[BundleDeployment[id=10291, name=Deployment [1] of Version [1.1.1] to [myDest]]], resource=[Resource[id=13802, uuid=ecb58f7d-a967-45f2-ac72-f39695efe600, type={JBossAS5}JBossAS Server, key=/home/biljana/JBoss/jboss-eap-5.1.2/jboss-eap-5.1/jboss-as/server/default, name=EAP bkramer.redhat.com:1099 default, version=EAP 5.1.2]]], full-deploy-directory=[/home/biljana/JBoss/jboss-eap-5.1.2/jboss-eap-5.1/jboss-as/server/default/deploy/myTest], clean=[false], revert=[false]]
java.lang.Exception: Failed to execute the bundle Ant script
	at org.rhq.plugins.ant.AntBundlePluginComponent.deployBundle(AntBundlePluginComponent.java:159)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:634)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.RuntimeException: Failed to execute bundle deploy file [/home/biljana/JON_312/rhq-agent/data/tmp/bundle-versions/10211/ant-bundle-recipe106831198048929530.xml]. Cause: /home/biljana/JON_312/rhq-agent/data/tmp/bundle-versions/10211/ant-bundle-recipe106831198048929530.xml:2: Failed to deploy bundle [fxmpDatasource] version [1.1.1]: java.lang.Exception: Failed to create new parent directory for raw file [/home/biljana/JBoss/jboss-eap-5.1.2/jboss-eap-5.1/jboss-as/server/default/deploy/myTest/../../conf/app.properties]

Attached agent.log excerpt that covers this and test bundle (info.zip).


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

How reproducible:
Always

Steps to Reproduce:
1. Attempt to deploy attached bundle 

  
Actual results:
The bundle is not deployed and java.lang.Exception: Failed to create new parent directory for raw file [...] is thrown.

Expected results:
The bundle should be properly deployed without any exception.


Additional info:

** If I add a new <rhq:file> element into deploy.xml that does not use destinationFile nor destinationDir, the deployment is properly done.

** Also, I tried to use the following as a workaround:

<project name="my-test-deployment" default="main" xmlns:rhq="antlib:org.rhq.bundle">
    <rhq:bundle name="myTest" version="1.1.1" description="first my-test deployment">
        <rhq:deployment-unit name="Datasource">
            <rhq:file name="app.properties" destinationFile="${rhq.deploy.dir}/../../conf/app.properties" replace="false"/>
        </rhq:deployment-unit>
    </rhq:bundle>
    <target name="main"/>
</project>

but this throws the same exception.

Comment 1 Lukas Krejci 2013-06-13 13:36:21 UTC
Apparently, this was fixed by mazz in commit 8ae20bd510aa660e94f70cad95fc680fd0dedd47.


Note You need to log in before you can comment on or make changes to this bug.