Bug 665855

Summary: JON241: Apache (EWS-1.0.1) > Operation failed with exception - java.lang.StringIndexOutOfBoundsException: String index out of range: -1
Product: [Other] RHQ Project Reporter: Rajan Timaniya <rtimaniy>
Component: OperationsAssignee: Lukas Krejci <lkrejci>
Status: CLOSED CURRENTRELEASE QA Contact: Sunil Kondkar <skondkar>
Severity: medium Docs Contact:
Priority: low    
Version: 4.0.0CC: hrupp, skondkar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 666848 (view as bug list) Environment:
Last Closed: 2013-08-31 13:13:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 616081, 666848    
Attachments:
Description Flags
screenshot none

Description Rajan Timaniya 2010-12-27 13:27:50 UTC
Created attachment 470848 [details]
screenshot

Description of problem:
Apache (EWS-1.0.1) > Operation failed with exception - 
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
        at java.lang.String.substring(String.java:1768)
        at org.rhq.plugins.apache.ApacheServerComponent.getControlScriptPath(ApacheServerComponent.java:663)
        at org.rhq.plugins.apache.ApacheServerOperationsDelegate.invokeOperation(ApacheServerOperationsDelegate.java:78)
        at org.rhq.plugins.apache.ApacheServerComponent.invokeOperation(ApacheServerComponent.java:299)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:592)
        at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:525)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)
        at java.lang.Thread.run(Thread.java:595)



Version-Release number of selected component (if applicable):
JON-2.4.1 build number: 10975:3cea406

How reproducible:
Always

Environment details:
OS: Win-2003 32bit
Java: Oracle JDK 1.5
Database: Postgres 8.4
EWS-1.0.1
Browser: IE-7 and FF-3.6.3

Steps to Reproduce:
1. Installed JON-2.4.1 and discover Apace (EWS-1.0.1)
2. Goto operations of Apache (EWS-1.0.1)
3. Perform operations like start, stop, restart, Restart Gracefully, etc.
4. Observe operation status
  
Actual results:
Apache (EWS-1.0.1) > Operation shows failed with exception - java.lang.StringIndexOutOfBoundsException: String index out of range: -1

Expected results:
Apache (EWS-1.0.1) > Operation should completed without any error or failure. 

Additional info:
Please refer attached screenshot.

Comment 1 Rajan Timaniya 2010-12-27 13:32:09 UTC
The bug will be tested on Apache-2.0.

Comment 2 Sunil Kondkar 2010-12-28 08:22:10 UTC
Tested on JON-2.4.1 build number: 10975:3cea406 with standalone instance of apache 2.2 after installation of jon241 apache libs onto a Windows platform.

Environment details:
OS: Win-2003 32bit
Java: Oracle JDK 1.5
Database: Postgres 8.3.8
Standalone Apache 2.2
Browser: IE-7

1. Installed JON-2.4.1 on windows platform and discovered standalone instance of Apache 2.2.
2. Navigated to operations tab of Apache.
3. Performed operations like start, stop, restart, Restart Gracefully, etc.
4. Observed the same exception as below:

java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1768) at org.rhq.plugins.apache.ApacheServerComponent.getControlScriptPath(ApacheServerComponent.java:663) at org.rhq.plugins.apache.ApacheServerOperationsDelegate.invokeOperation(ApacheServerOperationsDelegate.java:78) at org.rhq.plugins.apache.ApacheServerComponent.invokeOperation(ApacheServerComponent.java:299) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:592) at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:525) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269) at java.util.concurrent.FutureTask.run(FutureTask.java:123) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676) at java.lang.Thread.run(Thread.java:595)

Comment 3 Sunil Kondkar 2010-12-28 09:56:28 UTC
Also tested on standalone instance of apache 2.0.64 with the rt-filter and
  snmp libs for Apache 2.0

Observed the same exception as below while performing operations like start, stop, restart etc

java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1768) at org.rhq.plugins.apache.ApacheServerComponent.getControlScriptPath(ApacheServerComponent.java:663) at org.rhq.plugins.apache.ApacheServerOperationsDelegate.invokeOperation(ApacheServerOperationsDelegate.java:78) at org.rhq.plugins.apache.ApacheServerComponent.invokeOperation(ApacheServerComponent.java:299) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:592) at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:525) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269) at java.util.concurrent.FutureTask.run(FutureTask.java:123) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676) at java.lang.Thread.run(Thread.java:595)

Comment 4 Lukas Krejci 2011-01-03 12:26:59 UTC
commit c334fb6df2401e9927cd75cdc765dd6e6a4c3ae4
Author: Lukas Krejci <lkrejci>
Date:   Mon Jan 3 12:55:16 2011 +0100

    BZ 665855 - try to find the control script file only on the OSes that actually have a chance of having it.
    Be more careful about FS layout assumptions...

Comment 5 Rajan Timaniya 2011-01-04 13:22:27 UTC
Tested on JON-241 build #60 (build number: 10975:c334fb6)

Tested operations like start, stop, Restart Gracefully, Check Configuration File Syntax, etc with EWS-1.0.1, standalone Apache-2.2 and standalone Apache-2.0 on WIN-2003 (32bit) platform. Observed that operations working fine.