API Enablement

  • 1.  FFDC Exception = java.lang.StringIndexOutOfBoundsException

    IBM Champion
    Posted Thu October 01, 2020 10:55 AM
    Ive got

    ------Start of DE processing------ = ∇10/1/20 15:11:16:725 BST∆
    Exception = java.lang.StringIndexOutOfBoundsException
    Source = com.ibm.zosconnect.internal.web.ServiceProxyServlet$4
    probeid = 3243
    Stack Dump = java.lang.StringIndexOutOfBoundsException: String index out of range: 0
     at java.lang.String.substring(String.java:2695)
     at com.ibm.zosconnect.internal.web.ServiceProxyServlet$14.run(Unknown Source)
     at com.ibm.ws.webcontainer.async.ServiceWrapper.wrapAndRun(ServiceWrapper.java:236)
     at com.ibm.ws.webcontainer.async.ContextWrapper.run(ContextWrapper.java:28)
     at com.ibm.ws.webcontainer.async.WrapperRunnableImpl.run(WrapperRunnableImpl.java:89)
     at com.ibm.ws.threading.internal.ExecutorServiceImpl$RunnableWrapper.run(ExecutorServiceImpl.java:239)
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1160)
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
     at java.lang.Thread.run(Thread.java:818)
                                                                                                             
    Dump of callerThis
    null
    Dump of objectArray∇0∆
    Object type = java.lang.String

    Object type = java.lang.String
      String value = "https://10.1.3.10:9443/stockmanager/sapi-docs"
                                                                                       

    looks like an ffdc for a spelling mistake! sapi-docs

    is this a known problem?

    Colin



  • 2.  RE: FFDC Exception = java.lang.StringIndexOutOfBoundsException

    IBM Champion
    Posted Sun October 04, 2020 09:21 AM
      |   view attached
    I got a message saying it was unable to load the  attached file.  Ive attached it here

    ------------------------------
    Colin Paice
    ------------------------------

    Attachment(s)

    log
    ffdc_20.10.03_10.43.48.0.log   106 KB 1 version


  • 3.  RE: FFDC Exception = java.lang.StringIndexOutOfBoundsException

    IBM Champion
    Posted Sun October 04, 2020 09:34 AM
      |   view attached
    I upgraded to Java FP 15 and got this fdc

    ------------------------------
    Colin Paice
    ------------------------------

    Attachment(s)

    log
    ffdc2.log   106 KB 1 version


  • 4.  RE: FFDC Exception = java.lang.StringIndexOutOfBoundsException

    Posted Mon November 01, 2021 09:05 AM
    Since the string stores an array of characters, just like arrays the position of each character is represented by an index (starting from 0). If you try to access the character of a String at the index is either negative or greater than the size of the string, a StringIndexOutOfBoundsException is thrown. For some methods such as the java substring, charAt method, this exception also is thrown when the index is equal to the size of the string.

    How to solve the StringIndexOutOfBoundsException

    • Check the length of the string before using substring()
    • Exception handling using try...catch.


    ------------------------------
    mark vanber
    ------------------------------