Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 820570 - [as7] code in discovery that figures out System property (sysprop) values by parsing the server command line does not process -P/--properties option
Summary: [as7] code in discovery that figures out System property (sysprop) values by ...
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: 4.4
Hardware: Unspecified
OS: Unspecified
high vote
Target Milestone: ---
: JON 3.1.0
Assignee: Charles Crouch
QA Contact: Mike Foley
: 820584 (view as bug list)
Depends On: 819145 820584 820622
Blocks: as7-plugin jon310-sprint11, rhq44-sprint11
TreeView+ depends on / blocked
Reported: 2012-05-10 12:04 UTC by Ian Springer
Modified: 2015-02-01 23:28 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 819145
Last Closed: 2013-09-03 15:12:58 UTC

Attachments (Terms of Use)

Description Ian Springer 2012-05-10 12:04:23 UTC
+++ This bug was initially created as a clone of Bug #819145 +++ and both support the following command line options:

    -P=<url>                            Load system properties from the given 

    -P <url>                            Load system properties from the given 

    --properties=<url>                  Load system properties from the given 

--- Additional comment from on 2012-05-08 14:11:28 EDT ---

per BZ triage crouch, foley, loleary

--- Additional comment from on 2012-05-09 20:18:00 EDT ---

Fixed in master:;a=commitdiff;h=7b1a63a

Note, AS7 support more than one -P and/or --properties option on the same command line, and our code handles that.

Comment 1 Charles Crouch 2012-05-10 12:25:32 UTC
*** Bug 820584 has been marked as a duplicate of this bug. ***

Comment 2 Ian Springer 2012-05-10 14:10:01 UTC
Cherry-picked to the release/jon3.1.x branch:;a=commitdiff;h=0a6dab6

Comment 3 Viet Nguyen 2012-05-23 20:30:40 UTC
Does properties file path have to be absolute?  AS7 can process the following without any problem (values showed up in admin console)

./ -P -P=

JON Agent throws IllegalArgumentException: URI is not absolute

agent log
2012-05-23 16:25:57,601 ERROR [ResourceDiscoveryComponent.invoker.daemon-6] (rhq.modules.plugins.jbossas7.StandaloneASDiscovery)-
 Discovery of a JBossAS7 Standalone Server Resource failed for process: pid=[330], name=[java], ppid=[32746].
java.lang.IllegalArgumentException: URI is not absolute
        at org.rhq.modules.plugins.jbossas7.AS7CommandLine.toURL(
        at org.rhq.modules.plugins.jbossas7.AS7CommandLine.processClassArgument(
        at org.rhq.core.pluginapi.util.JavaCommandLine.parseClassArguments(
        at org.rhq.core.pluginapi.util.JavaCommandLine.parseCommandLine(
        at org.rhq.core.pluginapi.util.JavaCommandLine.<init>(
        at org.rhq.modules.plugins.jbossas7.AS7CommandLine.<init>(
        at org.rhq.modules.plugins.jbossas7.AS7CommandLine.<init>(
        at org.rhq.modules.plugins.jbossas7.BaseProcessDiscovery.discoverResources(

Comment 4 Libor Zoubek 2012-05-28 10:00:27 UTC
Moving ON_DEV, I get same exception as Viet - when passing relative path to properties file and server does not appear in discovery queue.

I've checked that relative path of properties file is based on process working directory (current directory when server is started)

On linux it should be easy to detect work dir for process (pwdx <pid>) but I am not sure about windows. 

If we cannot fully support this, please change the error message to something more user-friendly - for example : relative URL command line option to properties file is not supported

Comment 5 Ian Springer 2012-05-29 13:16:36 UTC
Fixed in master:;a=commitdiff;h=e9c19a7

Comment 6 Ian Springer 2012-05-29 13:18:15 UTC
Cherry-picked to release/jon3.1.x branch:;a=commitdiff;h=ff771bf

Comment 7 Libor Zoubek 2012-05-30 11:49:27 UTC
verified in JON 3.1.CR1, also added CLI automation

Comment 10 Heiko W. Rupp 2013-09-03 15:12:58 UTC
Bulk closing of old issues in VERIFIED state.

Note You need to log in before you can comment on or make changes to this bug.