Bug 536198 (RHQ-574)

Summary: operations can't have a list of maps for parameters
Product: [Other] RHQ Project Reporter: John Mazzitelli <mazz>
Component: OperationsAssignee: Charles Crouch <ccrouch>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0.1CC: cwelton, hbrock, mfoley
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
URL: http://jira.rhq-project.org/browse/RHQ-574
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-03 16:56:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 585306    

Description John Mazzitelli 2008-06-12 07:23:00 UTC
Put this operation definition in a plugin descriptor:

        <operation name="InvokeMethod"
            <parameters>
                <c:simple-property name="methodName" type="string" />
                <c:list-property name="parameters" required="false">
                    <c:map-property name="parameter">
                        <c:simple-property name="name" type="string" />
                        <c:simple-property name="value" type="string" />
                    </c:map-property>            
                </c:list-property>
            </parameters>
            <results>
                <c:simple-property name="results" type="longString"/>
            </results>
        </operation>

Now try to immediately schedule that operation.  The screen renders OK, but I cannot add any parameters.  I hit the "add" button in the map rendering, but it doesn't do anything.  I submit the operation anyway and I get a failure, a non-descript NPE in the stack trace.

org.rhq.core.clientapi.agent.PluginContainerException: Failed to submit invocation request. resource=[500051], operation=[InvokeRestMethod], jobId=[rhq-resource-500051-1435506829-1213254974555_=_rhq-resource-500051_=_1213254975416]
	at org.rhq.core.pc.operation.OperationManager.invokeOperation(OperationManager.java:149)
	at org.rhq.core.pc.operation.OperationManager.invokeOperation(OperationManager.java:108)
	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:585)
	at org.rhq.enterprise.communications.command.impl.remotepojo.server.RemotePojoInvocationCommandService.execute(RemotePojoInvocationCommandService.java:184)
	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:585)
	at com.sun.jmx.mbeanserver.StandardMetaDataImpl.invoke(StandardMetaDataImpl.java:414)
	at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
	at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:201)
	at $Proxy1.execute(Unknown Source)
	at org.rhq.enterprise.communications.command.server.CommandProcessor.handleIncomingInvocationRequest(CommandProcessor.java:335)
	at org.rhq.enterprise.communications.command.server.CommandProcessor.invoke(CommandProcessor.java:230)
	at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:734)
	at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:560)
	at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:369)
	at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:165)
Caused by: java.lang.NullPointerException: [Warning] null
	... 23 more

Comment 1 Joseph Marques 2008-06-13 18:08:31 UTC
mazz, do any existing operations have a definition like this, or is this only for a custom plugin you're writing now?

Comment 2 John Mazzitelli 2008-06-13 18:09:37 UTC
i think i'm the first to try this.  I don't know of any other plugins that (try to) do this.

Comment 3 Lukas Krejci 2009-08-27 12:58:01 UTC
This would come in handy for example to define environment variables of a script to execute by the operation.
This particular scenario can be worked around by putting the env vars in the plugin/resource configuration of the resource in question, but that seems a little bit ugly to me.

Comment 4 Lukas Krejci 2009-08-27 13:12:42 UTC
on the other hand, defining the list of env vars for the script in the plugin/resource config has the advantage of not having to define them every time the operation is run.

Comment 5 Red Hat Bugzilla 2009-11-10 21:12:12 UTC
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-574


Comment 6 Ian Springer 2011-02-11 22:33:29 UTC
This should no longer be an issue in coregui.

Comment 7 Mike Foley 2011-06-17 19:14:25 UTC
List of maps is supported for Config editor and Group Config editor.  Tested at 
http://localhost:7080/coregui/#Test/Configuration/ConfigEditor

Comment 9 Heiko W. Rupp 2013-09-03 16:56:43 UTC
Bulk closing of old issues that are in VERIFIED state.