Red Hat Bugzilla – Bug 699870
[JBoss AS] Discovery of AS instance fails if AS configDir is a URL
Last modified: 2011-10-12 10:45:15 EDT
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=, name=[java], ppid=, 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):
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
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=, name=[/usr/lib/jvm/java-1.6.0-sun-126.96.36.199/bin/java], ppid=, because configuration dir 'file:/opt/jboss/eap/jboss-eap-5.1/jboss-as/server/default does not exist or is not a directory.
EAP 5 instance should be discovered and no warning is logged
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.