Bug 856110 - CLI invocation for a DomainDeployment Proxy deployToServerGroup fails
Summary: CLI invocation for a DomainDeployment Proxy deployToServerGroup fails
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: CLI, Plugin -- JBoss EAP 6
Version: JON 3.1.0
Hardware: All
OS: All
high
high
Target Milestone: ---
: JON 3.1.2
Assignee: Jay Shaughnessy
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On: 856833
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-11 08:35 UTC by Mohamed Hamza Ben Mansour
Modified: 2018-11-30 19:48 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 856833 (view as bug list)
Environment:
Last Closed: 2013-09-11 10:58:35 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 207713 0 None None None 2012-09-12 21:26:51 UTC

Description Mohamed Hamza Ben Mansour 2012-09-11 08:35:11 UTC
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 Larry O'Leary 2012-09-12 22:18:24 UTC
Please note that invoking the same operation from the UI works just fine. I only get this error when invoking the operation via the CLI.

Comment 2 Larry O'Leary 2012-09-12 22:27:20 UTC
Here is the relevant part of the stack:

ERROR [org.rhq.enterprise.server.remote.RemoteSafeInvocationHandler] Failed to invoke remote request
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    ...
    at java.lang.Thread.run(Thread.java:636)
Caused by: javax.ejb.EJBException: 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].]
    at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
    ...
    at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:84)
    at $Proxy393.scheduleResourceOperation(Unknown Source)
    ... 75 more
Caused by: 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].]
    at org.rhq.enterprise.server.operation.OperationManagerBean.scheduleResourceOperation(OperationManagerBean.java:168)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    ...
    at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
    ... 92 more
Caused by: 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].]
    at org.rhq.enterprise.server.operation.OperationManagerBean.validateOperationNameAndParameters(OperationManagerBean.java:2130)
    at org.rhq.enterprise.server.operation.OperationManagerBean.scheduleResourceOperation(OperationManagerBean.java:215)
    at org.rhq.enterprise.server.operation.OperationManagerBean.scheduleResourceOperation(OperationManagerBean.java:166)
    ... 120 more

Comment 3 Jay Shaughnessy 2012-09-14 19:06:25 UTC
Fixed upstream.

Comment 5 John Mazzitelli 2012-11-13 14:45:18 UTC
cherry picked the master commit (c1ba47b0832ac7268c426d4111a2ee2e19c1e4ae):

a177c668faeefa7694c7315014835ccfd9a9a3ea

Comment 6 Simeon Pinder 2012-11-21 21:55:55 UTC
Moving to ON_QA as available for test with build : https://brewweb.devel.redhat.com//buildinfo?buildID=244662.

Comment 7 Filip Brychta 2012-11-28 16:09:45 UTC
Verified on 3.1.2.ER2. Successfully deployed war to server group using domainDeploymentProxy.deploytoServerGroup("helloworld.war", true, "main-server-group")


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