Bug 995088 - Discovery on Solaris 11 (64 bit jdk) results causes an java.lang.ArrayIndexOutOfBoundsException: 1
Discovery on Solaris 11 (64 bit jdk) results causes an java.lang.ArrayIndexOu...
Product: JBoss Operations Network
Classification: JBoss
Component: Plugin -- JBoss EAP 6 (Show other bugs)
JON 3.1.2
Unspecified Solaris
unspecified Severity urgent
: ER01
: JON 3.2.0
Assigned To: Thomas Segismont
Radim Hatlapatka
Depends On:
  Show dependency treegraph
Reported: 2013-08-08 10:07 EDT by Radim Hatlapatka
Modified: 2014-01-02 15:34 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Solaris 11 sparc Solaris 11 x86_64
Last Closed: 2014-01-02 15:34:01 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Radim Hatlapatka 2013-08-08 10:07:25 EDT
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 (], 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
Comment 2 Thomas Segismont 2013-09-12 10:18:41 EDT
Fixed in master

commit 6295aaf6cd4b808e0224d12458830f0908065a5b
Author: Thomas Segismont <tsegismo@redhat.com>
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.
Comment 3 Radim Hatlapatka 2013-10-04 04:03:05 EDT
Verified to be fixed with JON 3.2.0.ER2

Note You need to log in before you can comment on or make changes to this bug.