Bug 856833 - [as7] CLI invocation for a DomainDeployment Proxy deployToServerGroup fails
[as7] CLI invocation for a DomainDeployment Proxy deployToServerGroup fails
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: CLI, Plugins (Show other bugs)
4.4
All All
high Severity high (vote)
: ---
: RHQ 4.5.0
Assigned To: Jay Shaughnessy
Mike Foley
:
Depends On:
Blocks: 856110
  Show dependency treegraph
 
Reported: 2012-09-12 17:23 EDT by Larry O'Leary
Modified: 2013-09-01 06:12 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 856110
Environment:
Last Closed: 2013-09-01 06:12:25 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch (1.96 KB, patch)
2012-09-13 11:32 EDT, Libor Zoubek
no flags Details | Diff

  None (edit)
Description Larry O'Leary 2012-09-12 17:23:39 EDT
+++ This bug was initially created as a clone of product Bug #856110 +++

Description of problem:
After doing an initial deployment of a simple application on an EAP 6 domain via JON UI, I tried to update the backing content automatically and deploy to a ServerGroup via the following script : 

// B E G I N 
var resourceTypeCriteria = new ResourceTypeCriteria()
resourceTypeCriteria.addFilterName("DomainDeployment")
var deploymentTypeList = ResourceTypeManager.findResourceTypesByCriteria(resourceTypeCriteria)
var domainDeploymentType = deploymentTypeList.get(0)
var resourceCriteria = new ResourceCriteria()
resourceCriteria.addFilterResourceTypeId(domainDeploymentType.id)
resourceCriteria.addFilterResourceKey("deployment=jboss-as-log4j.war")
var domainDeploymentList = ResourceManager.findResourcesByCriteria(resourceCriteria)
var domainDeployment = domainDeploymentList.get(0)
var domainDeploymentProxy = ProxyFactory.getResource(domainDeployment.id)
domainDeploymentProxy.updateBackingContent("/home/mbenmans/NotBackedUp/JBoss/org/var result = domainDeploymentProxy.deploytoServerGroup("jboss-as-log4j.war", true, "other-server-group")AS/jboss-as-quickstarts-7.1.1.CR2/log4j/target/jboss-as-log4j.war", "9.0")
// E N D

The execution of the script ended with the follwing error message : 
Invoking operation deploytoServerGroup
sun.org.mozilla.javascript.internal.WrappedException: Wrapped javax.ejb.EJBException: [Warning] org.rhq.enterprise.server.exception.ScheduleException: java.lang.IllegalArgumentException: Parameters for [promote] on Resource of type [DomainDeployment] are not valid: [Required property 'server-group' was not set in Configuration[id=0].]




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


How reproducible:
Always

Steps to Reproduce:
1. Deploy jboss-as-log4j from quickstarts
2. Adapt the paths in the script
3. Execute via CLI
  
Actual results:
The execution of the script ended with the follwing error message : 
Invoking operation deploytoServerGroup
sun.org.mozilla.javascript.internal.WrappedException: Wrapped javax.ejb.EJBException: [Warning] org.rhq.enterprise.server.exception.ScheduleException: java.lang.IllegalArgumentException: Parameters for [promote] on Resource of type [DomainDeployment] are not valid: [Required property 'server-group' was not set in Configuration[id=0].]

Expected results:

A deployed App 

Additional info:
When first invoking the operation (ResourceClientProxy.invoke) we do a parameters translation via ConfigurationClassBuilder.translateParametersToConfig(..) wich calls ConfigurationClassBuilder.translateParameters(). In the body of this method when  building the configuration, we process the names of the PropertyDefinitions and we endup with a configuration containing a key (serverGroup) whereas in the DB we have "server-group". In the end in the validation process we never find the "Required property 'server-group'"
Comment 1 Libor Zoubek 2012-09-13 11:32:28 EDT
Created attachment 612493 [details]
patch
Comment 2 Jay Shaughnessy 2012-09-14 15:05:53 EDT
I independently came to the same fix as Libor in the above patch. I wish I had seen it  :-)

Master commit c1ba47b0832ac7268c426d4111a2ee2e19c1e4ae

This really had nothing to do with AS7, and everything to do with the
ResourceProxy code in the CLI, when it attempted to translate command-line
params to an operation Configuration.
Comment 3 Heiko W. Rupp 2013-09-01 06:12:25 EDT
Bulk closing of items that are on_qa and in old RHQ releases, which are out for a long time and where the issue has not been re-opened since.

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