Bug 880663

Summary: Deployment option 'Runtime Name' of DomainDeployment resource allows spaces which breaks some operations with that resource
Product: [Other] RHQ Project Reporter: Filip Brychta <fbrychta>
Component: CLI, Core UI, PluginsAssignee: RHQ Project Maintainer <rhq-maint>
Status: NEW --- QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.5CC: hrupp, jshaughn
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Filip Brychta 2012-11-27 09:38:16 EST
Description of problem:
It is possible to pass 'Runtime name' option containing spaces. DomainDeployment resource is successfully created, but some operations are failing because of those spaces. The issue is relevant for both cli and gui.

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

How reproducible:

Steps to Reproduce:
1. clean JON installation, eap6 is running in domain mode and is imported to JON's inventory
2. navigate to EAP Domain Controller->Inventory->Create Child and create DomainDeployment with 'Runtime name' option containing spaces  -  new resource is successfully created 
3. remove newly created resource
Actual results:

see child history tab:

java.lang.IllegalArgumentException: Delete for [deployment=hello world.war] failed: - Path 'deployment=hello world.war' is invalid as it contains spaces -, rolled-back=false, rolled-back=false
	at org.rhq.modules.plugins.jbossas7.BaseComponent.deleteResource(BaseComponent.java:317)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:634)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:679)

Expected results:
It is not possible to pass 'Runtime name' containing spaces

Additional info:

Relevant for both GUI and CLI using ResourceFactoryManager.createPackageBackedResource().

eap6 console (http://localhost:9990/console) removes this resource succesfully.

This issue can lead to following error during eap6 startup:
[Host Controller] 15:08:33,166 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("add") failed - address: ([("deployment" => "ch ch s")]) - failure description: "JBAS010876: No deployment content with hash c8182b0a864d2b52881c93e0e4116b86c9e5dfbb is available in the deployment content repository for deployment 'ch ch s'. This is a fatal boot error. To correct the problem, either restart with the --admin-only switch set and use the CLI to install the missing content or remove it from the configuration, or remove the deployment from the xml configuraiton file and restart."
[Host Controller] 15:08:33,169 FATAL [org.jboss.as.host.controller] (Controller Boot Thread) JBAS010933: Host Controller boot has failed in an unrecoverable manner; exiting. See previous messages for details.
[Host Controller] 15:08:33,184 INFO  [org.jboss.as] (MSC service thread 1-7) JBAS015950: JBoss EAP 6.0.0.GA (AS 7.1.2.Final-redhat-1) stopped in 11ms
Comment 1 Jay Shaughnessy 2014-08-29 15:14:02 EDT
This may have been solved with the fix for Bug 1119781 because we were using the runtime name as the deployment name and that may have led to an invalid deployment.

So, as of 4.12 this may be fixed.