Bug 534283 (RHQ-1094)

Summary: provide a new optional plugin config to the JMX plugin to specify additional EMS classpath entries
Product: [Other] RHQ Project Reporter: John Mazzitelli <mazz>
Component: PluginsAssignee: John Mazzitelli <mazz>
Status: CLOSED NEXTRELEASE QA Contact: Jeff Weiss <jweiss>
Severity: medium Docs Contact:
Priority: high    
Version: unspecifiedCC: dajohnso
Target Milestone: ---Keywords: Improvement
Target Release: ---   
Hardware: All   
OS: All   
URL: http://jira.rhq-project.org/browse/RHQ-1094
Whiteboard:
Fixed In Version: 1.2 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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: 534282    

Description John Mazzitelli 2008-11-09 19:32:00 UTC
In order to support allowing JMX plugin to connect and monitor arbitrary JVMs/resources, we need to be able to tell the EMS connection to add additional classpath entries.

For example, in order to connect and monitor Hibernate statistics, we need the tell EMS to not only connect to the hibernate JVM, we must also tell it where it can find the hibernate classes that will be returned by the hibernate statistics MBean (like the query stats object).

Suggest we add a new plugin config option in which you can specify one or more jars and/or directories containing jars.  The EMS connection will then be given the names of all the jars found (ie. they will be added to the EMS connections classpath entries).

Comment 1 John Mazzitelli 2008-11-09 20:11:46 UTC
I'll add this to the JMX Server resource type's plugin configuration:

<c:simple-property
   name="additionalClassPathEntries"
   required="false"
   type="string"
   description="Comma-separated list of directories and filenames that contain resources and classes needed to communicate with the JMX Server and its MBeans. If you specify 'some/directory/*.jar', all jars found in the given directory will be added."/>

EMS provides the ability to add class path entries of either directories or .jar filenames. Here, we allow you to specify 0, 1 or more .jar filenames, directory names (for location of resources like .xml or .properties files needed by the connection) or directory/*.jar (as the description indicates, this is where you can convienently add all jar files found in 'directory').

Comment 2 John Mazzitelli 2008-11-10 04:48:39 UTC
Verified this worked.  I was able to auto-discovery a running, standlone J2SE app with hibernate running inside it. I used this new plugin config setting to tell EMS where it can find the hibernate jars and was able to successfully execute hibernate plugin operations and collect hibernate stats.

Comment 3 John Mazzitelli 2009-02-18 16:05:03 UTC
All you need to test this is to look at or create any JMX Server resource (you can do a manual create if you'd like). Go to that server resource's inventory tab and confirm you see the new "additionalClassPathEntries" plugin configuration setting.

Optionally, to test this actually actually works you can do the stuff this demo did: http://management-platform.blogspot.com/2008/11/monitoring-hibernate.html

Comment 4 Jeff Weiss 2009-02-18 20:01:08 UTC
I used mazz's helloworld.jar (see rhq-1600 )  to test these hibernate entities, all worked as expected.  Could see the inventory items, metrics, etc.  rev3078

Comment 5 Red Hat Bugzilla 2009-11-10 20:23:49 UTC
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-1094
This bug incorporates RHQ-1001