Bug 699870

Summary: [JBoss AS] Discovery of AS instance fails if AS configDir is a URL
Product: [Other] RHQ Project Reporter: Larry O'Leary <loleary>
Component: PluginsAssignee: Nobody <nobody>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0.0CC: hrupp
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: 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:

Description Larry O'Leary 2011-04-26 19:41:15 UTC
Description of problem:
An AS instance which uses a URL for its system property jboss.server.home.dir can not be discovered because the plug-in claims the configuration directory does not exist or is not a directory:

Skipping discovery for JBoss AS process process: pid=[12255], name=[java], ppid=[12251], because configuration dir 'file:///opt/jboss/jboss-eap-5.1/jboss-as/server/default' does not exist or is not a directory.

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

How reproducible:
Always

Steps to Reproduce:
1. Start an EAP 5 instance using ./run.sh -c default -b 0.0.0.0 -Djboss.server.home.dir=file:///opt/jboss/eap/jboss-eap-5.1/jboss-as/server/default
2. Force a discovery scan for the agent running on the platform for this EAP server
  
Actual results:
EAP 5 instance is not discovered and agent logs the following warning:
WARN  [ResourceDiscoveryComponent.invoker.daemon-837] (org.rhq.plugins.jbossas5.ApplicationServerDiscoveryComponent)- Skipping discovery for JBoss AS process process: pid=[6314], name=[/usr/lib/jvm/java-1.6.0-sun-1.6.0.24/bin/java], ppid=[6267], because configuration dir 'file:/opt/jboss/eap/jboss-eap-5.1/jboss-as/server/default does not exist or is not a directory.


Expected results:
EAP 5 instance should be discovered and no warning is logged

Additional info:
This issue is caused by the assumption that the value for jboss.server.home.dir is a File. Instead, we should account for the possibility that a URL is provided instead of a file system path.