Bug 536198 (RHQ-574)
| Summary: | operations can't have a list of maps for parameters | ||
|---|---|---|---|
| Product: | [Other] RHQ Project | Reporter: | John Mazzitelli <mazz> |
| Component: | Operations | Assignee: | Charles Crouch <ccrouch> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 1.0.1 | CC: | 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 | ||
mazz, do any existing operations have a definition like this, or is this only for a custom plugin you're writing now? i think i'm the first to try this. I don't know of any other plugins that (try to) do this. 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. 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. This bug was previously known as http://jira.rhq-project.org/browse/RHQ-574 This should no longer be an issue in coregui. List of maps is supported for Config editor and Group Config editor. Tested at http://localhost:7080/coregui/#Test/Configuration/ConfigEditor Bulk closing of old issues that are in VERIFIED state. |
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