Bug 737175

Summary: as7 plugin: discovery of JBoss AS JVM child Resource fails
Product: [Other] RHQ Project Reporter: Ian Springer <ian.springer>
Component: PluginsAssignee: Libor Zoubek <lzoubek>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: high Docs Contact:
Priority: high    
Version: 4.1CC: ccrouch, hrupp, theute
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-04 07:49:10 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: 707223    

Description Ian Springer 2011-09-09 19:21:20 UTC
The as7 defines a JBoss AS JVM Resource type, similar to the ones defined by the as4 and as5 plugins:

      <server name="JBoss AS JVM"
              description="JVM of the JBossAS"
              sourcePlugin="JMX"
              sourceType="JMX Server"
              discovery="org.rhq.plugins.jmx.EmbeddedJMXServerDiscoveryComponent"
              class="org.rhq.plugins.jmx.JMXServerComponent"
              singleton="true">
        <runs-inside>
            <parent-resource-type name="JBossAS-Managed"  plugin="jboss-as-7"/>
            <parent-resource-type name="JBossAS7-Standalone"  plugin="jboss-as-7"/>
        </runs-inside>
      </server>


but discovery of this Resource fails with the following error in the Agent log:

2011-09-09 14:56:04,100 WARN  [InventoryManager.discovery-1] (rhq.core.pc.inventory.InventoryManager)- Failure during discovery for [JBoss AS JVM] Resources - failed after 1 ms.
java.lang.Exception: Discovery component invocation failed.
	at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:285)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassCastException: org.rhq.modules.plugins.jbossas7.StandaloneASComponent cannot be cast to org.rhq.plugins.jmx.JMXComponent
	at org.rhq.plugins.jmx.EmbeddedJMXServerDiscoveryComponent.discoverResources(EmbeddedJMXServerDiscoveryComponent.java:56)
	at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:281)
	... 5 more


It looks like we'll need to make BaseServerComponent implement JMXComponent in order to make this work.

Additionally, org.jboss.as.standalone and org.jboss.as.host-controller should be added to the process filters in JMXDiscoveryComponent to prevent the AS7 JVMs from also being discovered as standalone JMX Server Resources.

Comment 1 Heiko W. Rupp 2012-01-13 11:41:52 UTC
This dependency on JMX has been ripped out.

Comment 2 Ian Springer 2012-01-13 15:14:16 UTC
How will we be able to have a JVM child resource then? I think it's valuable to users to expose all the JVM MBeans (gc, threading, etc.) as we do for AS4/5/6. Let's discuss this some more.

Comment 3 Heiko W. Rupp 2012-03-02 15:27:18 UTC
AS7 exposes them via the management API, which the plugin queries.

Comment 5 Heiko W. Rupp 2013-09-04 07:49:10 UTC
Bulk closing of some old issues