Custom JMX plugin manual add not working
rafaelri Dec 11, 2008 6:57 AMHi all,
After a few days (and a few code changes) I've been able to connect to a secure Websphere installation and now I am able of manualling adding an Websphere JMX instance to Jopr.
Now I am trying to add my custom jmx plugin, the problem is even though my plugin has the flag suportsManualAdd=true it is failing with the following message on Jopr web ui:
An unexpected error occurred in the Agent. Failed to add resource with type [GifeManagement] and parent resource id [502662]. - Cause: org.rhq.core.clientapi.agent.PluginContainerException:The GifeJmx plugin does not support manual addition of 'GifeManagement' resources.
I've double checked the plugin zip file under jopr-agent-2.1.0.GA\plugins directory and indeed the latest version is there.
I'll paste below the top-most part of my plugin descriptor:
<plugin name="GifeJmx" displayName="Gife JMX Plugin" version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:xmlns:rhq-plugin" xmlns:c="urn:xmlns:rhq-configuration"> <depends plugin="JMX"/> <service name="GifeManagement" description="GifeManagement" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="org.rhq.plugins.jmx.MBeanResourceComponent" supportsManualAdd="true">
On the agent.log file, after I try to add the custom plugin, there is the following exception:
2008-12-11 09:48:11,991 INFO [WorkerThread#0[10.202.70.173:2531]] (rhq.core.pc.inventory.InventoryManager)- Plugin Warning: discovery component org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent returned no resources when passed a single plugin configuration (the plugin developer probably did not implement support for manually discovered resources). 2008-12-11 09:48:11,991 ERROR [WorkerThread#0[10.202.70.173:2531]] (rhq.core.pc.inventory.InventoryManager)- Manual add failed for resource of type 'GifeManagement' and parent resource id [502662]. org.rhq.core.clientapi.agent.PluginContainerException: The GifeJmx plugin does not support manual addition of 'GifeManagement' resources. at org.rhq.core.pc.inventory.InventoryManager.manuallyAddResource(InventoryManager.java:401) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) 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:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) at com.sun.jmx.mbeanserver.StandardMetaDataImpl.invoke(StandardMetaDataImpl.java:428) at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:238) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:833) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:802) at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:216) at $Proxy1.execute(Unknown Source) at org.rhq.enterprise.communications.command.server.CommandProcessor.handleIncomingInvocationRequest(CommandProcessor.java:358) at org.rhq.enterprise.communications.command.server.CommandProcessor.invoke(CommandProcessor.java:253) 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)
Am I missing any steps? Any flags on the rhq-plugin.xml file?
In order to keep it simple, I've hardcoded the objectName property of my custom jmx, so, I avoid introducing potential problems related to templating the objectName for now.
best regards,