I'm running into an issue trying to create a single plugin for a number of
different java services. We'd like to stick with a single plugin as it
eases deployment, but RHQ seems to have an issue with mixing JMX and
non-JMX.
In my rhq-plugin.xml I have a service (JMX) and a server component (custom
discovery class). If I place the JMX service first in the xml, I get the
following error when the plugin is uploaded to RHQ Server:
2013-04-26 20:23:49,256 WARN
[org.rhq.enterprise.server.core.plugin.PluginDeploymentScanner] Does not
look like [/local/rhq/rhq-server-3.0.0/plugins/myproduct-0.6.56.jar.fixme]
is a plugin jar -(Cause: java.lang.NullPointerException:no xml descriptor
found in jar). It will be ignored. Please fix that file or remove it.
If I place the server section first followed by the JMX service, the JMX
service is ignored and never discovered.
Is there something in the documentation that I'm missing that this isn't
supported or something invalid with the XML?
Thanks,
Ken
<plugin name="myProduct"
displayName="myProduct"
version="0.6.56"
package="com.test"
description="myProduct "
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"/>
<service name="ServiceOneJMX" description="ServiceOneJMX"
discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent"
class="org.rhq.plugins.jmx.MBeanResourceComponent"
singleton="true" >
<runs-inside>
<parent-resource-type name="JMX Server" plugin="JMX"
/>
</runs-inside>
<plugin-configuration>
<c:simple-property name="objectName"
default="com.test.monitoring:type=ServiceOneMBean" readOnly="true"
/>
<c:simple-property name="nameTemplate"
default="ServiceOneMBean" />
</plugin-configuration>
<metric property="MonitoringStartTime"
displayName="Last Service Restart"
displayType="summary"
defaultOn="true"
category="availability"
dataType="trait" />
<!-- If the below service is removed, JMX runs fine -->
<server name="ServiceTwo"
discovery="ServiceTwoDiscoveryComponent"
class="ServiceTwoComponent"
description="ServiceTwo"
singleton="true">
<process-scan name="unix"
query="process|basename|match=^java*,arg|org.apache.catalina.startup.Bootstrap|match=.*"
/>
<metric property="version"
displayName="ServiceTwo Version"
dataType="trait"
displayType="summary"
defaultInterval="900000"/>
</server>
</plugin>