This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours

Bug 771201

Summary: EPP 5.2 discovery fails with java.lang.StringIndexOutOfBoundsException
Product: [Other] RHQ Project Reporter: bkramer <bkramer>
Component: PluginsAssignee: Jay Shaughnessy <jshaughn>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: high Docs Contact:
Priority: urgent    
Version: 4.2CC: hrupp, jshaughn, loleary, lzoubek, tfonteyn
Target Milestone: ---   
Target Release: JON 3.0.1   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: 4.3 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 785851 (view as bug list) Environment:
Last Closed: 2013-09-03 11:16:38 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 781623, 781628, 781630, 785851, 798024    

Description bkramer 2012-01-02 07:35:49 EST
Description of problem:
Trying to discover and monitor EPP 5.2 with JON 3.0 but without success and the following is logged in the agent.log file:

2012-01-02 11:09:11,584 DEBUG [ResourceDiscoveryComponent.invoker.daemon-1] (rhq.plugins.jbossas.helper.JBossInstanceInfo)- Parsing JBossAS command line [/home/biljana/Java/jdk1.6.0_15/bin/java,, -server, -Xms1303m, -Xmx1303m, -XX:MaxPermSize=256m, -Dorg.jboss.resolver.warning=true, -Dsun.rmi.dgc.client.gcInterval=3600000, -Dsun.rmi.dgc.server.gcInterval=3600000, -Dsun.lang.ClassLoader.allowArraySyntax=true,, -Djava.endorsed.dirs=/home/biljana/EPP/jboss-epp-5.2/jboss-as/lib/endorsed, -classpath, /home/biljana/EPP/jboss-epp-5.2/jboss-as/bin/run.jar:/home/biljana/Java/jdk1.6.0_15/lib/tools.jar, org.jboss.Main, -c, default, -b,]...
2012-01-02 11:09:11,595 ERROR [ResourceDiscoveryComponent.invoker.daemon-1] (org.rhq.plugins.jbossas.JBossASDiscoveryComponent)- Failed to process JBoss AS command line: [/home/biljana/Java/jdk1.6.0_15/bin/java,, -server, -Xms1303m, -Xmx1303m, -XX:MaxPermSize=256m, -Dorg.jboss.resolver.warning=true, -Dsun.rmi.dgc.client.gcInterval=3600000, -Dsun.rmi.dgc.server.gcInterval=3600000, -Dsun.lang.ClassLoader.allowArraySyntax=true,, -Djava.endorsed.dirs=/home/biljana/EPP/jboss-epp-5.2/jboss-as/lib/endorsed, -classpath, /home/biljana/EPP/jboss-epp-5.2/jboss-as/bin/run.jar:/home/biljana/Java/jdk1.6.0_15/lib/tools.jar, org.jboss.Main, -c, default, -b,]
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
        at java.lang.String.substring(
        at org.rhq.plugins.jbossas.helper.JBossInstallationInfo.<init>(
        at org.rhq.plugins.jbossas.helper.JBossInstanceInfo.finalizeSysProps(
        at org.rhq.plugins.jbossas.helper.JBossInstanceInfo.<init>(
        at org.rhq.plugins.jbossas.JBossASDiscoveryComponent.processAutoDiscoveredProcesses(
        at org.rhq.plugins.jbossas.JBossASDiscoveryComponent.discoverResources(
        at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(
        at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$
        at java.util.concurrent.FutureTask$Sync.innerRun(
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
        at java.util.concurrent.ThreadPoolExecutor$

When using EPP 5.1.1, the server is properly discovered.

Version-Release number of selected component (if applicable):
JON 3.0.0.GA +
EPP 5.2

How reproducible:
Actual results:
EPP 5.2 is not discovered and java.lang.StringIndexOutOfBoundsException is logged in agent.log file.

Expected results:
EPP 5.2 is properly discovered by JON

Additional info:
Comment 1 Tom Fonteyne 2012-01-03 08:12:33 EST
run.jar MANIFEST entries:

Implementation-Version: 5.1.0 (build: SVNTag=JBPAPP_5_1_0 date=2010091

Implementation-Version: JBoss-EPP 5.2.0.GA (build: SVNTag=5.2.0.GA dat


115         int spaceIndex = validateImplementationVersion(implementationVersion);
116         String version = implementationVersion.substring(0, spaceIndex);

validateImplementationVersion() looks for the first space in the attribute, and treats that as version:


So 5.2 detection fails
Comment 3 Jay Shaughnessy 2012-01-06 09:22:28 EST
master commit 38ca523ad95e2fdc3adec301fef5f88951c6dd2a

EPP 5.2 has changed the format of its Implementation-Version string in the
manifest (5.1.1 was different).  Add support for the new format. Also,
in general, fail more gracefully when encountering an unexpected version

Test Notes:
Test EPP 5.2 discovery.  Ensure AS4 and AS5 plugins process correctly. AS4
should not throw errors (and should skip verthe process).  AS5 should not
throw errors and should discover an EPP 5.2 as an AS5 server resource. For
extra credit ensure that base EAP/AS/SOA 4,5 variants all still get
processed correctly.
Comment 5 Libor Zoubek 2012-01-30 13:45:04 EST
verified on Version: 3.0.1.GA Build Number: 784c8ce:5cde182
Comment 6 Charles Crouch 2012-01-30 14:06:58 EST
Removing RHQ4.3 from target version, we've got 785851 for that now.
Comment 7 Heiko W. Rupp 2013-09-03 11:16:38 EDT
Bulk closing of old issues in VERIFIED state.