Bug 807828

Summary: JMX Plugin - Unable to attach to jsvc.exec process; command line not available
Product: [Other] RHQ Project Reporter: Elias Ross <genman>
Component: PluginsAssignee: RHQ Project Maintainer <rhq-maint>
Status: NEW --- QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 4.3CC: hrupp
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
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: ---
Description Flags
Java program none

Description Elias Ross 2012-03-28 16:29:27 EDT
Description of problem:

Processes started with 'jsvc.exec' (Java Daemon loader, http://commons.apache.org/daemon/jsvc.html) do not provide command line information.

Thus org.rhq.plugins.jmx.util.ConnectionProviderFactory fails to connect to these processes. For example, run the attached program where jsvc.exec runs...

$ java -cp /usr/java/jdk1.6.0_17/lib/tools.jar:. Test
14489 14489 cl[Test] true null
32349 32349 cl[] true service:jmx:rmi://

The specific issue is:

import sun.jvmstat.monitor.MonitoredVmUtil;

s = MonitoredVmUtil.commandLine(monitoredvm);

returns an empty string. It appears that there is an empty string for 'java.rt.vmArgs' as well.

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

RHQ JMX plugin 4.4.0-SNAPSHOT

Additional info:

Bug was created at jsvc site: https://issues.apache.org/jira/browse/DAEMON-248
Work-around is to avoid the attach API for these processes.
Comment 1 Elias Ross 2012-03-28 16:33:03 EDT
Created attachment 573451 [details]
Java program
Comment 2 Elias Ross 2012-03-28 17:15:42 EDT
Basically, the bug is a request. I need another way to attach to these processes.

It might be that command line matching is done using Sigar.

I may or may not develop a fix for this.
Comment 3 Mike Foley 2012-04-02 12:00:09 EDT
set priority per BZ triage 4/2/2012 (crocuh, loleary, mfoley, asantos)
Comment 4 Heiko W. Rupp 2012-06-06 12:19:14 EDT
Ian has done the attach api addition, so he knows this part best.