Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1117423

Summary: RHQ Agent Running As Root and Java App Running As Root & Connecting via Dorg.rhq.resourceKey Is Not Discovered
Product: [JBoss] JBoss Operations Network Reporter: Matt Mahoney <mmahoney>
Component: Plugin -- OtherAssignee: Michael Burman <miburman>
Status: CLOSED CURRENTRELEASE QA Contact: Armine Hovsepyan <ahovsepy>
Severity: high Docs Contact:
Priority: unspecified    
Version: JON 3.2.2CC: ahovsepy, jshaughn, mfoley, miburman, mmahoney, myarboro
Target Milestone: ER03Keywords: Triaged
Target Release: JON 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-12-11 14:03:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
jmx_root_agent_app none

Description Matt Mahoney 2014-07-08 16:34:47 UTC
Description of problem:
RHQ Agent running as root does not discover Java app running as root & connecting via viaDorg.rhq.resourceKey

Version-Release number of selected component (if applicable):
RHQ 3.2.2 DR4

How reproducible:
Always

Steps to Reproduce:
1. As root, start RHQ Agent
2. As root, start Java app connecting via -Dorg.rhq.resourceKey=<string>
3.

Actual results:
Agent does not discover Java app

Expected results:
Agent should discover Java app.
This expected behaviour is as described in BZ: https://bugzilla.redhat.com/show_bug.cgi?id=799532#c4

Additional info:

Comment 3 Michael Burman 2014-08-13 16:58:47 UTC
I can't reproduce this bug. I created a java-application with just MBeans running, ran it as root and set the following parameters for it:

-Dorg.rhq.resourceKey=aegaeon 
-Dcom.sun.management.jmxremote.port=10190
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false

Given those parameters, a root agent could find it. The issue here is most likely to the fact that we can't find anything without those com.sun.management command line parameters, as we simply ignore them. Why is described in BZ 799532.

Comment 6 Jay Shaughnessy 2014-09-08 14:44:15 UTC
Are you running the agent with a JDK?  I believe you need the JDK to access the tool.jar, which has the Java Attach API support...

I agree that the reproduction attempt by Mike wasn't quite right because he enabled jmxremote, the attach API is only used if jmxremote isn't enabled.

Comment 8 Michael Burman 2014-09-17 08:10:11 UTC
Well, I tested this with just -Dorg.rhq.resourceKey=aegaeon and no other parameters, running as root and agent running as root. It was detected correctly (and I ran through the debugger the whole process and everything seemed to check out also). 

Jay's assumption that tools.jar was not correctly used (JRE instead of JDK) sounds like a correct assumption. The agent does print that to the logs, so it can be checked there.

Comment 9 Armine Hovsepyan 2014-09-23 15:45:14 UTC
Created attachment 940481 [details]
jmx_root_agent_app

Comment 10 Armine Hovsepyan 2014-09-23 15:45:50 UTC
verified in JON3.3 ER03, screen-shot attached