If more than one Apache process is running on a platform and discovery fails to load or parse the configuration file of one of the Apache instances, the entire discovery process is terminated leaving all Apache instances un-discovered. This is due to an exception that can bubble up and break the loop which iterates through each Apache instance in org.rhq.plugins.apache.ApacheServerDiscoveryComponent.discoverResources(ResourceDiscoveryContext<PlatformComponent> discoveryContext) when loadParser(serverConfigFile.getAbsolutePath(), serverRoot) is invoked. To reproduce (in JON 2.4): 1) Install Apache on a Windows platform at its default location (for example: C:\Program Files\Apache Software Foundation\Apache2.2) 2) Do not register Apache to start as a service, if it is, un-register it or set the service from Auto start to Manual start 3) Move the httpd.conf file from the Apache conf directory to an alternate location (For example: from C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf to C:\Program Files\Apache Software Foundation\00368619\Apache2.2\conf\httpd.conf) 4) Register an instance of Apache as a Windows Service and point it to the alternate configuration file (For example: "C:\Program Files\Apache Software Foundation\Apache2.2\bin\httpd.exe" -k install -n "Apache_00368619" -f "C:\Program Files\Apache Software Foundation\00368619\Apache2.2\conf\httpd.conf") 5) Have the Agent perform discovery The result should be that the configuration file could not be found for the first process discovered and the real process (with alternate configuration) will not be discovered due to the first process failing to be discovered.
Created attachment 460693 [details] Proposed patch based off rhq master Here is the proposed patch that will address this bug. It is confined to the specific test case described in the bug's original description.
commit bfa4afdfdf10b80f08113fcb31b301d5e2e958e1 Author: Lukas Krejci <lkrejci> Date: Thu Dec 16 19:25:54 2010 +0100 BZ 653695 - refactor the apache discovery to continue processing the rest of process scan results after an error during processing one of them.
Sunil, please look at this one while you all have the JON/Windows/Apache instance up.
Removing blocker against jon241 version of this bug
Verified on rhq 4.0.0-Snapshot build number:779b977 and also on jon241 build#62 (build number: 10993:e37f225) 1) Installed Apache 2.2.17 on a Windows platform at its default location (C:\Program Files\Apache Software Foundation\Apache2.2) 2) Set the Apache service from Auto start to Manual start. 3) Moved the httpd.conf file from the Apache conf directory to an alternate location (For example: from C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf to C:\Program Files\Apache Software Foundation\00368619\Apache2.2\conf\httpd.conf) 4) Registered an instance of Apache as a Windows Service and pointed it to the alternate configuration file (For example: "C:\Program Files\Apache Software Foundation\Apache2.2\bin\httpd.exe" -k install -n "Apache_00368619" -f "C:\Program Files\Apache Software Foundation\00368619\Apache2.2\conf\httpd.conf") Observed that the Apache server with alternate configuration (C:\Program Files\Apache Software Foundation\00368619\Apache2.2\conf\httpd.conf) is discovered.
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.