Red Hat Bugzilla – Bug 761212
Purge deployment causes deploy and conf directory to be deleted
Last modified: 2012-01-31 16:36:20 EST
Created attachment 542194 [details]
Description of problem:
I'm trying JON 3.0 bundles component with the new feature which allows the user to deploy to a group of non-platform components (such as servers). I have created a bundle which has a test application and a test config file. The complete bundle is attached.
I've deployed the bundle to a group of jboss servers and all is working fine. The files are correctly copied into conf and deploy.
After that, I've tried the "purge" button and it has caused the deletion of directories deploy and conf, which are the ones referenced in the bundle. So it left the server unusable.
Version-Release number of selected component (if applicable):
JBoss Operations Network 3.0 GA
Steps to Reproduce:
1. Create bundle with the provided file
2. Deploy the bundle to a server or server group using the profile directory as base location and deploy as deploy directory
3. Select the deployment and click Purge
4. conf and deploy directories are deleted
Bundle content deleted from the server. In this case, the application and the configuration file.
The server deploy and conf directories are deleted.
the first thing that caught my eye was:
I think this might cause other problems. Because you are now putting files OUTSIDE of the root bundle destination directory. Perhaps we should prohibit bundles from using ".." in paths like this in the recipe?
OK, and here I think is the culprit:
Because you are deploying this bundle to the deploy/ directory itself, you need to tell RHQ NOT to manage that root deploy directory (you do this by specifying manageRootDir="false" as an attribute to this deployment-unit element).
See these for more documention:
and the bottom of this blog post talks about this kind of use-case:
this demo might also provide some insight:
BTW: if you want to add not only a deployment artifact (like a WAR or EAR) but you also want to add additional things to the core server (like a new conf/ file), then you must do so either:
a) put the conf/ files as a separate bundle and deploy that bundle with manageRootDir=false to the conf/ directory
b) bundle your entire JbossAS installation with the full configuration that you want (with your conf/ and deploy/ artifacts in it) and deploy it, rather than simply deploy a war in an already existing JBossAS instance. In other words, provision the JBossAS server ITSELF via the bundle subsystem
I think the problem here is that the recipe needed to specify manageRootDir=false.
Closing as NOTABUG. Reopen if, after trying manageRootDir=false, problems still persist.