Description of problem: When both rhq agent and EAP 6 are started on Solaris 11 64 bit JDK the java process is discovered, but when looking for additional information from parent process it ends up with an exception thrown: java.lang.ArrayIndexOutOfBoundsException: 1 at org.rhq.core.pluginapi.util.ServerStartScriptDiscoveryUtility.getStartScriptIndex(ServerStartScriptDiscoveryUtility.java:308) at org.rhq.core.pluginapi.util.ServerStartScriptDiscoveryUtility.getStartScript(ServerStartScriptDiscoveryUtility.java:86) at org.rhq.modules.plugins.jbossas7.BaseProcessDiscovery.setStartScriptPluginConfigProps(BaseProcessDiscovery.java:252) at org.rhq.modules.plugins.jbossas7.BaseProcessDiscovery.buildResourceDetails(BaseProcessDiscovery.java:198) at org.rhq.modules.plugins.jbossas7.StandaloneASDiscovery.buildResourceDetails(StandaloneASDiscovery.java:84) at org.rhq.modules.plugins.jbossas7.BaseProcessDiscovery.discoverResources(BaseProcessDiscovery.java:136) at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:293) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:724) Version-Release number of selected component (if applicable): Tested with JON 3.1.2 and EAP 6.1.1.ER4 How reproducible: always Steps to Reproduce: 1. Start EAP in standalone mode with JAVA_OPTS containing -d64 in order to be started on 64 bit JDK 2. Start agent also on 64 bit JDK (can be achieved by adding -d64 to RHQ_AGENT_ADDITIONAL_JAVA_OPTS), or the EAP6 server won't be discovered at all. 3. run discovery in the agent 4. see discovery output + agent log Actual results: 10:30:46 JBossAS7.JBossAS7 Standalone Server: Starting discovery... 10:30:46 JBossAS7.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=[23666], name=[/qa/tools/opt/solaris10_x86/jdk1.7.0_25/bin/amd64/java], ppid=[23648]] 10:30:46 JBossAS7.JBossAS7 Standalone Server: Done. + exception in agent log causing that the server is not manageable by JON server Expected results: something like (note there are two lines regarding what was discovered): JBossAS7.JBossAS7 Standalone Server: Starting discovery... JBossAS7.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=[12714], name=[/qa/tools/opt/solaris10_x86/jdk1.6.0_45/bin/amd64/java], ppid=[12691]] JBossAS7.JBossAS7 Standalone Server: key=[/mnt/hudson_workspace/workspace/eap-6x-jon-plugin-ui-solaris-intel-standalone/1cad110a/jboss-eap-6.1/standalone], name=[EAP (10.16.92.19:10040)], version=[EAP 6.1.1.GA], description=[Standalone JBoss Enterprise Application Platform 6 server] JBossAS7.JBossAS7 Standalone Server: Done. without the exception in log resulting in successful discovery which is then manageable by JON server Additional info: This happens only on Solaris 11 and only with 64 bit JDK
Fixed in master commit 6295aaf6cd4b808e0224d12458830f0908065a5b Author: Thomas Segismont <tsegismo> Date: Thu Sep 12 16:14:59 2013 +0200 On Solaris with 64 bit VM (-d64), parent process command line may be empty, and we assumed the command line would always hold 1 element at least Fix tested on Solaris 11.1 with agent and EAP6.1 running on 64 bit server JVMs. The discovery process will set up sensible defaults for the resource plugin configurations. I was able to execute a restart operation successfully.
Verified to be fixed with JON 3.2.0.ER2