Similar to earlier versions of AS, it's possible to run multiple standalone AS7 servers out of the same JBOSS_HOME dir (see https://issues.jboss.org/browse/AS7-1752). So we should be using the canonical path of the server "base dir" (e.g. /opt/jboss-as-7.1.1.Final/standalone2), rather than the JBOSS_HOME dir, as the Resource key. Similarly, for domain AS7 servers (i.e. host controllers), it's possible to run multiple instances on the same box, either out of the same JBOSS_HOME dir, or out of different JBOSS_HOME dirs. In either case, we cannot use a constant value of "HostController" or "DomainController" as we currently do. Instead we should probably use the server "base dir" (e.g. /opt/jboss-as-7.1.1.Final/domain2), just as I proposed for standalone instances.
Fixed in master: http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commit;h=4600e41 Here is output from the Agent prompt discovery command that demonstrates the new keys: jboss-as-7.JBossAS7 Host Controller: Starting discovery... jboss-as-7.JBossAS7 Host Controller: Process scan detected a server - scan=[ProcessScan: query=[process|basename|match=^java.*,arg|org.jboss.as.host-controller|match=.*], name=[HostController]], process=[process: pid=[21838], name=[/usr/java/jdk1.6.0_30/bin/java], ppid=[21817]] jboss-as-7.JBossAS7 Host Controller: Process scan detected a server - scan=[ProcessScan: query=[process|basename|match=^java.*,arg|org.jboss.as.host-controller|match=.*], name=[HostController]], process=[process: pid=[21121], name=[/usr/java/jdk1.6.0_30/bin/java], ppid=[21100]] jboss-as-7.JBossAS7 Host Controller: key=[/home/ips/Applications/jboss-as-7.1.1.Final/domain1], name=[domain1 JBoss AS 7 Domain Controller], version=[7.1.1.Final], description=[Domain controller for a JBoss Application Server 7 domain] jboss-as-7.JBossAS7 Host Controller: key=[/home/ips/Applications/jboss-as-7.1.1.Final/domain2], name=[domain2 JBoss AS 7 Domain Controller], version=[7.1.1.Final], description=[Domain controller for a JBoss Application Server 7 domain] jboss-as-7.JBossAS7 Host Controller: Done. jboss-as-7.JBossAS7 Standalone Server: Starting discovery... jboss-as-7.JBossAS7 Standalone Server: Process scan detected a server - scan=[ProcessScan: query=[process|basename|match=^java.*,arg|org.jboss.as.standalone|match=.*], name=[StandaloneAS]], process=[process: pid=[22346], name=[/usr/java/jdk1.6.0_30/bin/java], ppid=[22221]] jboss-as-7.JBossAS7 Standalone Server: Process scan detected a server - scan=[ProcessScan: query=[process|basename|match=^java.*,arg|org.jboss.as.standalone|match=.*], name=[StandaloneAS]], process=[process: pid=[22345], name=[/usr/java/jdk1.6.0_30/bin/java], ppid=[22218]] jboss-as-7.JBossAS7 Standalone Server: key=[/home/ips/Applications/jboss-as-7.1.1.Final/standalone2], name=[AS7 jetengine], version=[AS7 7.1.1.Final], description=[Standalone JBoss Application Server 7 server] jboss-as-7.JBossAS7 Standalone Server: key=[/home/ips/Applications/jboss-as-7.1.1.Final/standalone1], name=[AS7 jetengine], version=[AS7 7.1.1.Final], description=[Standalone JBoss Application Server 7 server] jboss-as-7.JBossAS7 Standalone Server: Done. To QA this, the jboss-as-spawn.sh script, in RHQ git under etc/scripts/, can be used to spawn multiple AS instances on the same box.
I am actually going to reopen this, since I forgot to support relative paths for the values of the various jboss.*.dir System properties, e.g.: -Djboss.server.base.dir=standalone2 standalone2 is a relative path and should get resolved as follows: File baseDir = new File(homeDir, "standalone2"); We'll need to support relative paths for the following sysprops: jboss.home.dir jboss.server.base.dir jboss.server.config.dir jboss.domain.base.dir jboss.domain.config.dir org.jboss.boot.log.file The base path used to resolve the relative paths will vary depending on the sysprop.
jboss.*.dir sysprops set to relative paths are now resolved the same way AS7 itself resolves them: jboss.home.dir - resolved relative to cwd jboss.server.base.dir, jboss.domain.base.dir - resolved relative to cwd, if that fails, resolved relative to jboss.home.dir jboss.server.config.dir, jboss.domain.config.dir, jboss.server.log.dir, jboss.domain.log.dir - resolved relative to cwd (master http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commitdiff;h=1c3f8bc)
Bulk closing of old issues in VERIFIED state.