I previously had a simple customized JMX server working which included an application MBean with %engine% and %port% as dynamic parts of the name. It successfully discovered the MBean and a couple of metrics.
Today, I tried to refine it so that it would discover all the MBeans and all by replacing a fixed string with the %interaction% variable to the objectName pattern and the new simple-property element for it. There are about 15 MBeans matching this pattern. The XML comment below illustrates a concrete MBean name.
Now, the resource is not dynamically discovered so I tried manually adding it and get this error:
There are no connection properties defined for ResourceType[id=10222, category=Server, name=Initiate JMX server, plugin=Initiate Hub]
(At one point, in error, I changed the plugin name from "Initiate JMX" to "Initiate Hub". After some work, it nows accepts this new name.)
This is the new plugin descriptor. Can anyone suggest what the problen night be?
<plugin name="Initiate Hub" displayName="Initiate Hub JMX Interface" description="Extends the JMX Plugin to support the Initiate Mbeans" version="1.7" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:xmlns:rhq-plugin" xmlns:c="urn:xmlns:rhq-configuration">
<depends plugin="JMX" useClasses="true"/>
<server name="Initiate JMX server" supportsManualAdd="true" createDeletePolicy="both"> <!-- Initiate services (One service per mbean) -->
<service name="Initiate Interaction MBean" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="org.rhq.plugins.jmx.MBeanResourceComponent" description="Initiate interaction metrics">
<runs-inside> <parent-resource-type name="JMX Server" plugin="JMX"/> </runs-inside>
<plugin-configuration> <c:simple-property name="objectName" readOnly="true"
default="com.initiatesystems:service=%engine%,category=Listeners,id=%por t%,type=Interactions,ixn=%interaction%"/> <!-- default="com.initiatesystems:service=MPINETEMPI_UAT,category=Listeners,i d=16070,type=Interactions,ixn=MEMSEARCH"/> --> <c:simple-property name="nameTemplate" default="{engine}:{port} {interaction}"/> <c:simple-property name="descriptionTemplate" default="Initiate Hub {engine} on port {port} Interaction [interaction}"/> <c:simple-property name="engine" type="string" description="Engine instance name"/> <c:simple-property name="port" type="integer" description="Listener port number"/> <c:simple-property name="interaction" type="string" description="Interaction type"/>
</plugin-configuration>
<metric displayName="Audit level for the specific interaction" etc...
Al Amyot | Consultant Sierra Systems
(eHealth): 204-926-4257 (T): 204-942-2575 (F): 204-942-2047 444 St. Mary Avenue, Suite 1050 Winnipeg, MB R3C 3T1
Management Consulting | System Integration | Managed Services website: www.SierraSystems.com http://www.sierrasystems.com/
This email and/or any documents in this transmission is intended for the addressee(s) only and may contain legally privileged or confidential information. Any unauthorized use, disclosure, distribution, copying or dissemination is strictly prohibited. If you receive this transmission in error, please notify the sender immediately and return the original.
Ce courriel et tout document dans cette transmission est destiné à la personne ou aux personnes à qui il est adressé. Il peut contenir des informations privilégiées ou confidentielles. Toute utilisation, divulgation, distribution, copie, ou diffusion non autorisée est strictement défendue. Si vous n'êtes pas le destinataire de ce message, veuillez en informer l'expéditeur immédiatement et lui remettre l'original.
The runs inside:
<runs-inside> <parent-resource-type name="JMX Server" plugin="JMX"/> </runs-inside>
looks to be out of place no? Shouldn't that be inside the <server> element, not inside the child <service> element?
Unsure if that's the cause of your problem, but that's the thing that jumped out at me when I looked.
Here's the same section from the Plugin Demo - Writing Custom JMX Plugin:
<service name="First Custom Service" description="Our first MBean custom service whose 'id' is static"
discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="org.rhq.plugins.jmx.MBeanResourceComponent">
<runs-inside> <parent-resource-type name="JMX Server" plugin="JMX"/> <parent-resource-type name="JBossAS Server" plugin="JBossAS"/> </runs-inside>
I just followed the above example.
I did find one error but fixing it had no effect:
<c:simple-property name="descriptionTemplate" default="Initiate Hub {engine} on port {port} Interaction [interaction}"/> should be: <c:simple-property name="descriptionTemplate" default="Initiate Hub {engine} on port {port} Interaction {interaction}"/> Notice the erroneous "["
Al Amyot | Consultant Sierra Systems
(eHealth): 204-926-4257 (T): 204-942-2575 (F): 204-942-2047 444 St. Mary Avenue, Suite 1050 Winnipeg, MB R3C 3T1
Management Consulting | System Integration | Managed Services website: www.SierraSystems.com
-----Original Message----- From: rhq-users-bounces@lists.fedorahosted.org [mailto:rhq-users-bounces@lists.fedorahosted.org] On Behalf Of John Mazzitelli Sent: Thursday, November 18, 2010 3:51 PM To: rhq-users@lists.fedorahosted.org Subject: Re: Custom JMX plugin problems
The runs inside:
<runs-inside> <parent-resource-type name="JMX Server" plugin="JMX"/> </runs-inside>
looks to be out of place no? Shouldn't that be inside the <server> element, not inside the child <service> element?
Unsure if that's the cause of your problem, but that's the thing that jumped out at me when I looked. _______________________________________________ rhq-users mailing list rhq-users@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/rhq-users
This email and/or any documents in this transmission is intended for the addressee(s) only and may contain legally privileged or confidential information. Any unauthorized use, disclosure, distribution, copying or dissemination is strictly prohibited. If you receive this transmission in error, please notify the sender immediately and return the original.
Ce courriel et tout document dans cette transmission est destiné à la personne ou aux personnes à qui il est adressé. Il peut contenir des informations privilégiées ou confidentielles. Toute utilisation, divulgation, distribution, copie, ou diffusion non autorisée est strictement défendue. Si vous n'êtes pas le destinataire de ce message, veuillez en informer l'expéditeur immédiatement et lui remettre l'original.
Yeah, but in the custom jmx demo case, that <service> is the top level resource.
In your case, your top level resource (<server name="Initiate JMX server">) doesn't have the <runs-inside> in it. But your child service does - which doesn't make sense because the child <service> by definition runs inside the parent <server> where its declared. We should probably spit out a warning of some sort if we detect this - I don't think it makes sense to put a <runs-inside> inside of anything other than a top-level resource.
In fact, our documents allude to this - read here:
http://rhq-project.org/display/RHQ/AMPS-Plugin+Extensions#AMPS-PluginExtensi...
where it says
"Injection: A root level <server> or <service> can have a <runs-inside> element. "
Also notice the "For the future" yellow box where it asks if we would want to allow for a non-root-level type to accept runs-inside.
So while not explicitly saying so, they infer that you can't have runs-inside in anything other than a root-level (aka top-level) type.
On 11/18/2010 04:57 PM, Al Amyot wrote:
Here's the same section from the Plugin Demo - Writing Custom JMX Plugin:
<service name="First Custom Service" description="Our first MBean custom service whose 'id' is
static"
discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="org.rhq.plugins.jmx.MBeanResourceComponent">
<runs-inside> <parent-resource-type name="JMX Server" plugin="JMX"/> <parent-resource-type name="JBossAS Server" plugin="JBossAS"/> </runs-inside>
I just followed the above example.
I did find one error but fixing it had no effect:
<c:simple-property name="descriptionTemplate" default="Initiate Hub {engine} on port {port} Interaction [interaction}"/> should be: <c:simple-property name="descriptionTemplate" default="Initiate Hub {engine} on port {port} Interaction {interaction}"/> Notice the erroneous "["
Al Amyot | Consultant Sierra Systems
(eHealth): 204-926-4257 (T): 204-942-2575 (F): 204-942-2047 444 St. Mary Avenue, Suite 1050 Winnipeg, MB R3C 3T1
Management Consulting | System Integration | Managed Services website: www.SierraSystems.com
-----Original Message----- From: rhq-users-bounces@lists.fedorahosted.org [mailto:rhq-users-bounces@lists.fedorahosted.org] On Behalf Of John Mazzitelli Sent: Thursday, November 18, 2010 3:51 PM To: rhq-users@lists.fedorahosted.org Subject: Re: Custom JMX plugin problems
The runs inside:
<runs-inside> <parent-resource-type name="JMX Server" plugin="JMX"/> </runs-inside>
looks to be out of place no? Shouldn't that be inside the<server> element, not inside the child<service> element?
Unsure if that's the cause of your problem, but that's the thing that jumped out at me when I looked. _______________________________________________ rhq-users mailing list rhq-users@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/rhq-users
This email and/or any documents in this transmission is intended for the addressee(s) only and may contain legally privileged or confidential information. Any unauthorized use, disclosure, distribution, copying or dissemination is strictly prohibited. If you receive this transmission in error, please notify the sender immediately and return the original.
Ce courriel et tout document dans cette transmission est destiné à la personne ou aux personnes à qui il est adressé. Il peut contenir des informations privilégiées ou confidentielles. Toute utilisation, divulgation, distribution, copie, ou diffusion non autorisée est strictement défendue. Si vous n'êtes pas le destinataire de ce message, veuillez en informer l'expéditeur immédiatement et lui remettre l'original.
rhq-users mailing list rhq-users@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/rhq-users
Having made that change, the agent logs this error:
2010-11-18 16:22:23,961 ERROR [InventoryManager.discovery-1] (rhq.core.pc.inventory.RuntimeDiscoveryExecutor)- Unable to obtain discovery component for [ResourceType[id=0, category=Server, name=Initiate JMX server, plugin=Initiate Hub]] org.rhq.core.clientapi.agent.PluginContainerException: Plugin class was 'null' using loader [PluginClassLoader@4b794b79[parent=PluginClassLoader@5d2b5d2b[parent=org.rhq.core.pc.plugin.RootPluginClassLoader@74157415,embedded-dir=[file:/opt/rhq/rhq-agent/data/tmp/rhq-jmx-plugin-3.0.0.jar28960.classloader/],urls=[file:/opt/rhq/rhq-agent/plugins/rhq-jmx-plugin-3.0.0.jar,org-mc4j-ems-1.2.11.jar28961.tmp]],embedded-dir=[<>],urls=[file:/opt/rhq/rhq-agent/plugins/initiate-empi.jar]]]
I expected that the "depends " attribute caused this plugin to inherit the discovery of the JMX plugin.
Here is the descriptor now:
Al Amyot | Consultant Sierra Systems
(eHealth): 204-926-4257 (T): 204-942-2575 (F): 204-942-2047 444 St. Mary Avenue, Suite 1050 Winnipeg, MB R3C 3T1
Management Consulting | System Integration | Managed Services website: www.SierraSystems.com
-----Original Message----- From: rhq-users-bounces@lists.fedorahosted.org [mailto:rhq-users-bounces@lists.fedorahosted.org] On Behalf Of John Mazzitelli Sent: Thursday, November 18, 2010 4:07 PM To: rhq-users@lists.fedorahosted.org Subject: Re: Custom JMX plugin problems
Yeah, but in the custom jmx demo case, that <service> is the top level resource.
In your case, your top level resource (<server name="Initiate JMX server">) doesn't have the <runs-inside> in it. But your child service does - which doesn't make sense because the child <service> by definition runs inside the parent <server> where its declared. We should probably spit out a warning of some sort if we detect this - I don't think it makes sense to put a <runs-inside> inside of anything other than a top-level resource.
In fact, our documents allude to this - read here:
http://rhq-project.org/display/RHQ/AMPS-Plugin+Extensions#AMPS-PluginExtensi...
where it says
"Injection: A root level <server> or <service> can have a <runs-inside> element. "
Also notice the "For the future" yellow box where it asks if we would want to allow for a non-root-level type to accept runs-inside.
So while not explicitly saying so, they infer that you can't have runs-inside in anything other than a root-level (aka top-level) type.
On 11/18/2010 04:57 PM, Al Amyot wrote:
Here's the same section from the Plugin Demo - Writing Custom JMX Plugin:
<service name="First Custom Service" description="Our first MBean custom service whose 'id' is
static"
discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="org.rhq.plugins.jmx.MBeanResourceComponent">
<runs-inside> <parent-resource-type name="JMX Server" plugin="JMX"/> <parent-resource-type name="JBossAS Server" plugin="JBossAS"/> </runs-inside>
I just followed the above example.
I did find one error but fixing it had no effect:
<c:simple-property name="descriptionTemplate" default="Initiate Hub {engine} on port {port} Interaction [interaction}"/> should be: <c:simple-property name="descriptionTemplate" default="Initiate Hub {engine} on port {port} Interaction {interaction}"/> Notice the erroneous "["
Al Amyot | Consultant Sierra Systems
(eHealth): 204-926-4257 (T): 204-942-2575 (F): 204-942-2047 444 St. Mary Avenue, Suite 1050 Winnipeg, MB R3C 3T1
Management Consulting | System Integration | Managed Services website: www.SierraSystems.com
-----Original Message----- From: rhq-users-bounces@lists.fedorahosted.org [mailto:rhq-users-bounces@lists.fedorahosted.org] On Behalf Of John Mazzitelli Sent: Thursday, November 18, 2010 3:51 PM To: rhq-users@lists.fedorahosted.org Subject: Re: Custom JMX plugin problems
The runs inside:
<runs-inside> <parent-resource-type name="JMX Server" plugin="JMX"/> </runs-inside>
looks to be out of place no? Shouldn't that be inside the<server> element, not inside the child<service> element?
Unsure if that's the cause of your problem, but that's the thing that jumped out at me when I looked. _______________________________________________ rhq-users mailing list rhq-users@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/rhq-users
This email and/or any documents in this transmission is intended for the addressee(s) only and may contain legally privileged or confidential information. Any unauthorized use, disclosure, distribution, copying or dissemination is strictly prohibited. If you receive this transmission in error, please notify the sender immediately and return the original.
Ce courriel et tout document dans cette transmission est destiné à la personne ou aux personnes à qui il est adressé. Il peut contenir des informations privilégiées ou confidentielles. Toute utilisation, divulgation, distribution, copie, ou diffusion non autorisée est strictement défendue. Si vous n'êtes pas le destinataire de ce message, veuillez en informer l'expéditeur immédiatement et lui remettre l'original.
rhq-users mailing list rhq-users@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/rhq-users
_______________________________________________ rhq-users mailing list rhq-users@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/rhq-users This email and/or any documents in this transmission is intended for the addressee(s) only and may contain legally privileged or confidential information. Any unauthorized use, disclosure, distribution, copying or dissemination is strictly prohibited. If you receive this transmission in error, please notify the sender immediately and return the original.
Ce courriel et tout document dans cette transmission est destiné à la personne ou aux personnes à qui il est adressé. Il peut contenir des informations privilégiées ou confidentielles. Toute utilisation, divulgation, distribution, copie, ou diffusion non autorisée est strictement défendue. Si vous n'êtes pas le destinataire de ce message, veuillez en informer l'expéditeur immédiatement et lui remettre l'original.
On Thursday, November 18, 2010 23:30:28 Al Amyot wrote:
Having made that change, the agent logs this error:
2010-11-18 16:22:23,961 ERROR [InventoryManager.discovery-1] (rhq.core.pc.inventory.RuntimeDiscoveryExecutor)- Unable to obtain discovery component for [ResourceType[id=0, category=Server, name=Initiate JMX server, plugin=Initiate Hub]] org.rhq.core.clientapi.agent.PluginContainerException: Plugin class was 'null' using loader [PluginClassLoader@4b794b79[parent=PluginClassLoader@5d2b5d2b[parent=org.r hq.core.pc.plugin.RootPluginClassLoader@74157415,embedded-dir=[file:/opt/rh q/rhq-agent/data/tmp/rhq-jmx-plugin-3.0.0.jar28960.classloader/],urls=[file :/opt/rhq/rhq-agent/plugins/rhq-jmx-plugin-3.0.0.jar,org-mc4j-ems-1.2.11.ja r28961.tmp]],embedded-dir=[<>],urls=[file:/opt/rhq/rhq-agent/plugins/initia te-empi.jar]]]
I expected that the "depends " attribute caused this plugin to inherit the discovery of the JMX plugin.
The <depends> tag says that your plugin depends on the resource types (and uses classes) of the JMX plugin. But the JMX plugin defines a number of resource types and discovery and component classes so you still have to specify the class name of both the discovery (discovery attribute) and component classes (class attribute) for each resource type you define in your plugin descriptor. You can specify ones from the JMX plugin (because you have "useClasses=true" in the depends tag) or you can specify your own if you have custom discovery and component classes in your plugin.
The discovery and class attributes aren't required on the <platform>, <server> or <service> elements because the resource type can be specified as a copy of another. Please consult http://rhq-project.org/display/RHQ/AMPS- Plugin+Descriptor for the details.
Here is the descriptor now:
Al Amyot | Consultant Sierra Systems
(eHealth): 204-926-4257 (T): 204-942-2575 (F): 204-942-2047 444 St. Mary Avenue, Suite 1050 Winnipeg, MB R3C 3T1
Management Consulting | System Integration | Managed Services website: www.SierraSystems.com
-----Original Message----- From: rhq-users-bounces@lists.fedorahosted.org [mailto:rhq-users-bounces@lists.fedorahosted.org] On Behalf Of John Mazzitelli Sent: Thursday, November 18, 2010 4:07 PM To: rhq-users@lists.fedorahosted.org Subject: Re: Custom JMX plugin problems
Yeah, but in the custom jmx demo case, that <service> is the top level resource.
In your case, your top level resource (<server name="Initiate JMX server">) doesn't have the <runs-inside> in it. But your child service does
- which doesn't make sense because the child <service> by definition runs
inside the parent <server> where its declared. We should probably spit out a warning of some sort if we detect this - I don't think it makes sense to put a <runs-inside> inside of anything other than a top-level resource.
In fact, our documents allude to this - read here:
http://rhq-project.org/display/RHQ/AMPS-Plugin+Extensions#AMPS-PluginExtens ions-Caveats
where it says
"Injection: A root level <server> or <service> can have a <runs-inside> element. "
Also notice the "For the future" yellow box where it asks if we would want to allow for a non-root-level type to accept runs-inside.
So while not explicitly saying so, they infer that you can't have runs-inside in anything other than a root-level (aka top-level) type.
On 11/18/2010 04:57 PM, Al Amyot wrote:
Here's the same section from the Plugin Demo - Writing Custom JMX
Plugin: <service name="First Custom Service"
description="Our first MBean custom service whose 'id' is
static"
discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent"
class="org.rhq.plugins.jmx.MBeanResourceComponent"> <runs-inside> <parent-resource-type name="JMX Server" plugin="JMX"/> <parent-resource-type name="JBossAS Server" plugin="JBossAS"/> </runs-inside>
I just followed the above example.
I did find one error but fixing it had no effect:
<c:simple-property name="descriptionTemplate" default="Initiate Hub {engine} on port {port} Interaction [interaction}"/> should be: <c:simple-property name="descriptionTemplate" default="Initiate Hub {engine} on port {port} Interaction {interaction}"/> Notice the erroneous "["
Al Amyot | Consultant Sierra Systems
(eHealth): 204-926-4257 (T): 204-942-2575 (F): 204-942-2047 444 St. Mary Avenue, Suite 1050 Winnipeg, MB R3C 3T1
Management Consulting | System Integration | Managed Services website: www.SierraSystems.com
-----Original Message----- From: rhq-users-bounces@lists.fedorahosted.org [mailto:rhq-users-bounces@lists.fedorahosted.org] On Behalf Of John Mazzitelli Sent: Thursday, November 18, 2010 3:51 PM To: rhq-users@lists.fedorahosted.org Subject: Re: Custom JMX plugin problems
The runs inside:
<runs-inside> <parent-resource-type name="JMX Server" plugin="JMX"/> </runs-inside>
looks to be out of place no? Shouldn't that be inside the<server> element, not inside the child<service> element?
Unsure if that's the cause of your problem, but that's the thing that jumped out at me when I looked. _______________________________________________ rhq-users mailing list rhq-users@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/rhq-users
This email and/or any documents in this transmission is intended for the addressee(s) only and may contain legally privileged or confidential information. Any unauthorized use, disclosure, distribution, copying or dissemination is strictly prohibited. If you receive this transmission in error, please notify the sender immediately and return the original.
Ce courriel et tout document dans cette transmission est destiné à la personne ou aux personnes à qui il est adressé. Il peut contenir des informations privilégiées ou confidentielles. Toute utilisation, divulgation, distribution, copie, ou diffusion non autorisée est strictement défendue. Si vous n'êtes pas le destinataire de ce message, veuillez en informer l'expéditeur immédiatement et lui remettre l'original.
rhq-users mailing list rhq-users@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/rhq-users
rhq-users mailing list rhq-users@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/rhq-users This email and/or any documents in this transmission is intended for the addressee(s) only and may contain legally privileged or confidential information. Any unauthorized use, disclosure, distribution, copying or dissemination is strictly prohibited. If you receive this transmission in error, please notify the sender immediately and return the original.
Ce courriel et tout document dans cette transmission est destiné à la personne ou aux personnes à qui il est adressé. Il peut contenir des informations privilégiées ou confidentielles. Toute utilisation, divulgation, distribution, copie, ou diffusion non autorisée est strictement défendue. Si vous n'êtes pas le destinataire de ce message, veuillez en informer l'expéditeur immédiatement et lui remettre l'original.
rhq-users mailing list rhq-users@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/rhq-users
Thanks for everyone's help
I removed the <server> element and the MBeans were all discovered successfully using the builtin MBeanResourceDiscoveryComponent class:
<?xml version="1.0" encoding="UTF-8" ?>
<plugin name="Initiate Hub" displayName="Initiate Hub JMX Interface" description="Extends the JMX Plugin to support the Initiate Mbeans" version="1.14" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:xmlns:rhq-plugin" xmlns:c="urn:xmlns:rhq-configuration"> <depends plugin="JMX" useClasses="true"/>
<!-- Initiate services (One service per mbean) -->
<service name="Initiate Interaction MBean" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="org.rhq.plugins.jmx.MBeanResourceComponent" description="Initiate interaction metrics">
<runs-inside> <parent-resource-type name="JMX Server" plugin="JMX"/> </runs-inside>
<plugin-configuration> <!-- <c:simple-property name="objectName" readOnly="true" default="com.initiatesystems:service=MPINETEMPI_UAT,category=Listeners,id=16070,type=Interactions,ixn=MEMSEARCH"/> --> <c:simple-property name="objectName" readOnly="true" default="com.initiatesystems:service=%engine%,category=Listeners,id=%port%,type=Interactions,ixn=%interaction%"/> <c:simple-property name="nameTemplate" default="{engine}:{port} {interaction}"/> <c:simple-property name="descriptionTemplate" default="Initiate Hub {engine} on port {port} Interaction {interaction}"/> <c:simple-property name="engine" type="string" description="Engine instance name"/> <c:simple-property name="port" type="integer" description="Listener port number"/> <c:simple-property name="interaction" type="string" description="Interaction type"/> </plugin-configuration>
<metric displayName="Audit level for the specific interaction"
Al Amyot | Consultant Sierra Systems
(eHealth): 204-926-4257 (T): 204-942-2575 (F): 204-942-2047 444 St. Mary Avenue, Suite 1050 Winnipeg, MB R3C 3T1
Management Consulting | System Integration | Managed Services website: www.SierraSystems.com
-----Original Message----- From: rhq-users-bounces@lists.fedorahosted.org [mailto:rhq-users-bounces@lists.fedorahosted.org] On Behalf Of Lukas Krejci Sent: Friday, November 19, 2010 2:08 AM To: rhq-users@lists.fedorahosted.org Subject: Re: Custom JMX plugin problems
On Thursday, November 18, 2010 23:30:28 Al Amyot wrote:
Having made that change, the agent logs this error:
2010-11-18 16:22:23,961 ERROR [InventoryManager.discovery-1] (rhq.core.pc.inventory.RuntimeDiscoveryExecutor)- Unable to obtain discovery component for [ResourceType[id=0, category=Server, name=Initiate JMX server, plugin=Initiate Hub]] org.rhq.core.clientapi.agent.PluginContainerException: Plugin class was 'null' using loader [PluginClassLoader@4b794b79[parent=PluginClassLoader@5d2b5d2b[parent=o rg.r hq.core.pc.plugin.RootPluginClassLoader@74157415,embedded-dir=[file:/o pt/rh q/rhq-agent/data/tmp/rhq-jmx-plugin-3.0.0.jar28960.classloader/],urls= [file :/opt/rhq/rhq-agent/plugins/rhq-jmx-plugin-3.0.0.jar,org-mc4j-ems-1.2. 11.ja r28961.tmp]],embedded-dir=[<>],urls=[file:/opt/rhq/rhq-agent/plugins/i nitia te-empi.jar]]]
I expected that the "depends " attribute caused this plugin to inherit the discovery of the JMX plugin.
The <depends> tag says that your plugin depends on the resource types (and uses classes) of the JMX plugin. But the JMX plugin defines a number of resource types and discovery and component classes so you still have to specify the class name of both the discovery (discovery attribute) and component classes (class attribute) for each resource type you define in your plugin descriptor. You can specify ones from the JMX plugin (because you have "useClasses=true" in the depends tag) or you can specify your own if you have custom discovery and component classes in your plugin.
The discovery and class attributes aren't required on the <platform>, <server> or <service> elements because the resource type can be specified as a copy of another. Please consult http://rhq-project.org/display/RHQ/AMPS- Plugin+Descriptor for the details.
Here is the descriptor now:
Al Amyot | Consultant Sierra Systems
(eHealth): 204-926-4257 (T): 204-942-2575 (F): 204-942-2047 444 St. Mary Avenue, Suite 1050 Winnipeg, MB R3C 3T1
Management Consulting | System Integration | Managed Services website: www.SierraSystems.com
-----Original Message----- From: rhq-users-bounces@lists.fedorahosted.org [mailto:rhq-users-bounces@lists.fedorahosted.org] On Behalf Of John Mazzitelli Sent: Thursday, November 18, 2010 4:07 PM To: rhq-users@lists.fedorahosted.org Subject: Re: Custom JMX plugin problems
Yeah, but in the custom jmx demo case, that <service> is the top level resource.
In your case, your top level resource (<server name="Initiate JMX server">) doesn't have the <runs-inside> in it. But your child service does
- which doesn't make sense because the child <service> by definition
runs inside the parent <server> where its declared. We should probably spit out a warning of some sort if we detect this - I don't think it makes sense to put a <runs-inside> inside of anything other than a top-level resource.
In fact, our documents allude to this - read here:
http://rhq-project.org/display/RHQ/AMPS-Plugin+Extensions#AMPS-PluginE xtens ions-Caveats
where it says
"Injection: A root level <server> or <service> can have a <runs-inside> element. "
Also notice the "For the future" yellow box where it asks if we would want to allow for a non-root-level type to accept runs-inside.
So while not explicitly saying so, they infer that you can't have runs-inside in anything other than a root-level (aka top-level) type.
On 11/18/2010 04:57 PM, Al Amyot wrote:
Here's the same section from the Plugin Demo - Writing Custom JMX
Plugin: <service name="First Custom Service"
description="Our first MBean custom service whose 'id'
is
static"
discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent"
class="org.rhq.plugins.jmx.MBeanResourceComponent"> <runs-inside> <parent-resource-type name="JMX Server" plugin="JMX"/> <parent-resource-type name="JBossAS Server"
plugin="JBossAS"/>
</runs-inside>
I just followed the above example.
I did find one error but fixing it had no effect:
<c:simple-property name="descriptionTemplate" default="Initiate Hub {engine} on port {port} Interaction [interaction}"/> should be: <c:simple-property name="descriptionTemplate" default="Initiate Hub {engine} on port {port} Interaction {interaction}"/> Notice the erroneous "["
Al Amyot | Consultant Sierra Systems
(eHealth): 204-926-4257 (T): 204-942-2575 (F): 204-942-2047 444 St. Mary Avenue, Suite 1050 Winnipeg, MB R3C 3T1
Management Consulting | System Integration | Managed Services website: www.SierraSystems.com
-----Original Message----- From: rhq-users-bounces@lists.fedorahosted.org [mailto:rhq-users-bounces@lists.fedorahosted.org] On Behalf Of John Mazzitelli Sent: Thursday, November 18, 2010 3:51 PM To: rhq-users@lists.fedorahosted.org Subject: Re: Custom JMX plugin problems
The runs inside:
<runs-inside> <parent-resource-type name="JMX Server" plugin="JMX"/> </runs-inside>
looks to be out of place no? Shouldn't that be inside the<server> element, not inside the child<service> element?
Unsure if that's the cause of your problem, but that's the thing that jumped out at me when I looked. _______________________________________________ rhq-users mailing list rhq-users@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/rhq-users
This email and/or any documents in this transmission is intended for the addressee(s) only and may contain legally privileged or confidential information. Any unauthorized use, disclosure, distribution, copying or dissemination is strictly prohibited. If you receive this transmission in error, please notify the sender immediately and return the original.
Ce courriel et tout document dans cette transmission est destiné à la personne ou aux personnes à qui il est adressé. Il peut contenir des informations privilégiées ou confidentielles. Toute utilisation, divulgation, distribution, copie, ou diffusion non autorisée est strictement défendue. Si vous n'êtes pas le destinataire de ce message, veuillez en informer l'expéditeur immédiatement et lui remettre l'original.
rhq-users mailing list rhq-users@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/rhq-users
rhq-users mailing list rhq-users@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/rhq-users This email and/or any documents in this transmission is intended for the addressee(s) only and may contain legally privileged or confidential information. Any unauthorized use, disclosure, distribution, copying or dissemination is strictly prohibited. If you receive this transmission in error, please notify the sender immediately and return the original.
Ce courriel et tout document dans cette transmission est destiné à la personne ou aux personnes à qui il est adressé. Il peut contenir des informations privilégiées ou confidentielles. Toute utilisation, divulgation, distribution, copie, ou diffusion non autorisée est strictement défendue. Si vous n'êtes pas le destinataire de ce message, veuillez en informer l'expéditeur immédiatement et lui remettre l'original.
rhq-users mailing list rhq-users@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/rhq-users
_______________________________________________ rhq-users mailing list rhq-users@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/rhq-users This email and/or any documents in this transmission is intended for the addressee(s) only and may contain legally privileged or confidential information. Any unauthorized use, disclosure, distribution, copying or dissemination is strictly prohibited. If you receive this transmission in error, please notify the sender immediately and return the original.
Ce courriel et tout document dans cette transmission est destiné à la personne ou aux personnes à qui il est adressé. Il peut contenir des informations privilégiées ou confidentielles. Toute utilisation, divulgation, distribution, copie, ou diffusion non autorisée est strictement défendue. Si vous n'êtes pas le destinataire de ce message, veuillez en informer l'expéditeur immédiatement et lui remettre l'original.
here is the desciptor now:
<?xml version="1.0" encoding="UTF-8" ?>
<plugin name="Initiate Hub" displayName="Initiate Hub JMX Interface" description="Extends the JMX Plugin to support the Initiate Mbeans" version="1.13" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:xmlns:rhq-plugin" xmlns:c="urn:xmlns:rhq-configuration"> <depends plugin="JMX" useClasses="true"/> <server name="Initiate JMX server" supportsManualAdd="true" createDeletePolicy="both">
<runs-inside> <parent-resource-type name="JMX Server" plugin="JMX"/> </runs-inside>
<!-- Initiate services (One service per mbean) -->
<service name="Initiate Interaction MBean" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="org.rhq.plugins.jmx.MBeanResourceComponent" description="Initiate interaction metrics">
<plugin-configuration> <!-- <c:simple-property name="objectName" readOnly="true" default="com.initiatesystems:service=MPINETEMPI_UAT,category=Listeners,id=16070,type=Interactions,ixn=MEMSEARCH"/> --> <c:simple-property name="objectName" readOnly="true" default="com.initiatesystems:service=%engine%,category=Listeners,id=%port%,type=Interactions,ixn=%interaction%"/> <c:simple-property name="nameTemplate" default="{engine}:{port} {interaction}"/> <c:simple-property name="descriptionTemplate" default="Initiate Hub {engine} on port {port} Interaction {interaction}"/> <c:simple-property name="engine" type="string" description="Engine instance name"/> <c:simple-property name="port" type="integer" description="Listener port number"/> <c:simple-property name="interaction" type="string" description="Interaction type"/> </plugin-configuration>
<metric displayName="Audit level for the specific interaction" etc...
Al Amyot | Consultant Sierra Systems
(eHealth): 204-926-4257 (T): 204-942-2575 (F): 204-942-2047 444 St. Mary Avenue, Suite 1050 Winnipeg, MB R3C 3T1
Management Consulting | System Integration | Managed Services website: www.SierraSystems.com
-----Original Message----- From: rhq-users-bounces@lists.fedorahosted.org [mailto:rhq-users-bounces@lists.fedorahosted.org] On Behalf Of John Mazzitelli Sent: Thursday, November 18, 2010 4:07 PM To: rhq-users@lists.fedorahosted.org Subject: Re: Custom JMX plugin problems
Yeah, but in the custom jmx demo case, that <service> is the top level resource.
In your case, your top level resource (<server name="Initiate JMX server">) doesn't have the <runs-inside> in it. But your child service does - which doesn't make sense because the child <service> by definition runs inside the parent <server> where its declared. We should probably spit out a warning of some sort if we detect this - I don't think it makes sense to put a <runs-inside> inside of anything other than a top-level resource.
In fact, our documents allude to this - read here:
http://rhq-project.org/display/RHQ/AMPS-Plugin+Extensions#AMPS-PluginExtensi...
where it says
"Injection: A root level <server> or <service> can have a <runs-inside> element. "
Also notice the "For the future" yellow box where it asks if we would want to allow for a non-root-level type to accept runs-inside.
So while not explicitly saying so, they infer that you can't have runs-inside in anything other than a root-level (aka top-level) type.
On 11/18/2010 04:57 PM, Al Amyot wrote:
Here's the same section from the Plugin Demo - Writing Custom JMX Plugin:
<service name="First Custom Service" description="Our first MBean custom service whose 'id' is
static"
discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="org.rhq.plugins.jmx.MBeanResourceComponent">
<runs-inside> <parent-resource-type name="JMX Server" plugin="JMX"/> <parent-resource-type name="JBossAS Server" plugin="JBossAS"/> </runs-inside>
I just followed the above example.
I did find one error but fixing it had no effect:
<c:simple-property name="descriptionTemplate" default="Initiate Hub {engine} on port {port} Interaction [interaction}"/> should be: <c:simple-property name="descriptionTemplate" default="Initiate Hub {engine} on port {port} Interaction {interaction}"/> Notice the erroneous "["
Al Amyot | Consultant Sierra Systems
(eHealth): 204-926-4257 (T): 204-942-2575 (F): 204-942-2047 444 St. Mary Avenue, Suite 1050 Winnipeg, MB R3C 3T1
Management Consulting | System Integration | Managed Services website: www.SierraSystems.com
-----Original Message----- From: rhq-users-bounces@lists.fedorahosted.org [mailto:rhq-users-bounces@lists.fedorahosted.org] On Behalf Of John Mazzitelli Sent: Thursday, November 18, 2010 3:51 PM To: rhq-users@lists.fedorahosted.org Subject: Re: Custom JMX plugin problems
The runs inside:
<runs-inside> <parent-resource-type name="JMX Server" plugin="JMX"/> </runs-inside>
looks to be out of place no? Shouldn't that be inside the<server> element, not inside the child<service> element?
Unsure if that's the cause of your problem, but that's the thing that jumped out at me when I looked. _______________________________________________ rhq-users mailing list rhq-users@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/rhq-users
This email and/or any documents in this transmission is intended for the addressee(s) only and may contain legally privileged or confidential information. Any unauthorized use, disclosure, distribution, copying or dissemination is strictly prohibited. If you receive this transmission in error, please notify the sender immediately and return the original.
Ce courriel et tout document dans cette transmission est destiné à la personne ou aux personnes à qui il est adressé. Il peut contenir des informations privilégiées ou confidentielles. Toute utilisation, divulgation, distribution, copie, ou diffusion non autorisée est strictement défendue. Si vous n'êtes pas le destinataire de ce message, veuillez en informer l'expéditeur immédiatement et lui remettre l'original.
rhq-users mailing list rhq-users@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/rhq-users
_______________________________________________ rhq-users mailing list rhq-users@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/rhq-users This email and/or any documents in this transmission is intended for the addressee(s) only and may contain legally privileged or confidential information. Any unauthorized use, disclosure, distribution, copying or dissemination is strictly prohibited. If you receive this transmission in error, please notify the sender immediately and return the original.
Ce courriel et tout document dans cette transmission est destiné à la personne ou aux personnes à qui il est adressé. Il peut contenir des informations privilégiées ou confidentielles. Toute utilisation, divulgation, distribution, copie, ou diffusion non autorisée est strictement défendue. Si vous n'êtes pas le destinataire de ce message, veuillez en informer l'expéditeur immédiatement et lui remettre l'original.
rhq-users@lists.stg.fedorahosted.org