java.lang.StringIndexOutOfBoundsException: String index out of range: 22

Pentaho BI Platform Tracking | Michael Frysinger | 8 years ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to rafael . Or join the community to write better ones.
  1. 0

    Single and double quotes are not ignored in a comment string within a Execute SQL Script step in a transformation. I entered only the following simple comment string /* "Test */ in a Execute SQL Script object and ran the transformation. I get the following error: 2009/08/26 14:41:38 - Execute SQL script.0 - Connected to database... 2009/08/26 14:41:38 - Execute SQL script - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : Error initializing step [Execute SQL script] 2009/08/26 14:41:38 - Execute SQL script - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : java.lang.StringIndexOutOfBoundsException: String index out of range: 22 2009/08/26 14:41:38 - Execute SQL script - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : at java.lang.String.charAt(Unknown Source) 2009/08/26 14:41:38 - Execute SQL script - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : at org.pentaho.di.core.database.Database.execStatements(Database.java:1598) 2009/08/26 14:41:38 - Execute SQL script - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : at org.pentaho.di.trans.steps.sql.ExecSQL.init(ExecSQL.java:280) 2009/08/26 14:41:38 - Execute SQL script - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : at org.pentaho.di.trans.step.StepInitThread.run(StepInitThread.java:48) 2009/08/26 14:41:38 - Execute SQL script - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : at java.lang.Thread.run(Unknown Source) 2009/08/26 14:41:38 - bug - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : Step [Execute SQL script.0] failed to initialize! 2009/08/26 14:41:38 - Execute SQL script.0 - Finished reading query, closing connection. 2009/08/26 14:41:41 - BID - Connection to database closed! 2009/08/26 14:41:41 - bug - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : Preparing transformation execution failed 2009/08/26 14:41:41 - bug - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : org.pentaho.di.core.exception.KettleException: 2009/08/26 14:41:41 - bug - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : We failed to initialize at least one step. Execution can not begin! 2009/08/26 14:41:41 - bug - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : 2009/08/26 14:41:41 - bug - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : 2009/08/26 14:41:41 - bug - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : at org.pentaho.di.trans.Trans.prepareExecution(Trans.java:677) 2009/08/26 14:41:41 - bug - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : at org.pentaho.di.ui.spoon.trans.TransGraph$25.run(TransGraph.java:3192) 2009/08/26 14:41:41 - bug - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : at java.lang.Thread.run(Unknown Source) If I add the correct number of quotes like the following: /* "Test" */ , then no error occurs as expected.

    Pentaho BI Platform Tracking | 8 years ago | Michael Frysinger
    java.lang.StringIndexOutOfBoundsException: String index out of range: 22
  2. 0

    Single and double quotes are not ignored in a comment string within a Execute SQL Script step in a transformation. I entered only the following simple comment string /* "Test */ in a Execute SQL Script object and ran the transformation. I get the following error: 2009/08/26 14:41:38 - Execute SQL script.0 - Connected to database... 2009/08/26 14:41:38 - Execute SQL script - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : Error initializing step [Execute SQL script] 2009/08/26 14:41:38 - Execute SQL script - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : java.lang.StringIndexOutOfBoundsException: String index out of range: 22 2009/08/26 14:41:38 - Execute SQL script - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : at java.lang.String.charAt(Unknown Source) 2009/08/26 14:41:38 - Execute SQL script - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : at org.pentaho.di.core.database.Database.execStatements(Database.java:1598) 2009/08/26 14:41:38 - Execute SQL script - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : at org.pentaho.di.trans.steps.sql.ExecSQL.init(ExecSQL.java:280) 2009/08/26 14:41:38 - Execute SQL script - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : at org.pentaho.di.trans.step.StepInitThread.run(StepInitThread.java:48) 2009/08/26 14:41:38 - Execute SQL script - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : at java.lang.Thread.run(Unknown Source) 2009/08/26 14:41:38 - bug - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : Step [Execute SQL script.0] failed to initialize! 2009/08/26 14:41:38 - Execute SQL script.0 - Finished reading query, closing connection. 2009/08/26 14:41:41 - BID - Connection to database closed! 2009/08/26 14:41:41 - bug - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : Preparing transformation execution failed 2009/08/26 14:41:41 - bug - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : org.pentaho.di.core.exception.KettleException: 2009/08/26 14:41:41 - bug - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : We failed to initialize at least one step. Execution can not begin! 2009/08/26 14:41:41 - bug - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : 2009/08/26 14:41:41 - bug - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : 2009/08/26 14:41:41 - bug - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : at org.pentaho.di.trans.Trans.prepareExecution(Trans.java:677) 2009/08/26 14:41:41 - bug - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : at org.pentaho.di.ui.spoon.trans.TransGraph$25.run(TransGraph.java:3192) 2009/08/26 14:41:41 - bug - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : at java.lang.Thread.run(Unknown Source) If I add the correct number of quotes like the following: /* "Test" */ , then no error occurs as expected.

    Pentaho BI Platform Tracking | 8 years ago | Michael Frysinger
    java.lang.StringIndexOutOfBoundsException: String index out of range: 22
  3. 0
    samebug tip
    Thrown by String methods to indicate that an index is either negative or greater than the size of the string. For some methods such as the charAt method, this exception also is thrown when the index is equal to the size of the string.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    StringIndexOutOfBoundsException while decoding

    Stack Overflow | 5 years ago | i2ijeya
    java.lang.StringIndexOutOfBoundsException: String index out of range: 22
  6. 0

    GitHub comment 3887#223722022

    GitHub | 10 months ago | douglasjunior
    java.lang.StringIndexOutOfBoundsException: String index out of range: 22

  1. linxiaolong 1 times, last 1 month ago
  2. jokester 1 times, last 1 month ago
  3. tyson925 1 times, last 2 months ago
  4. Torasque 1 times, last 3 months ago
  5. Hronom 32257 times, last 3 months ago
11 more registered users
18 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.StringIndexOutOfBoundsException

    String index out of range: 22

    at java.lang.String.charAt()
  2. Java RT
    String.charAt
    1. java.lang.String.charAt(Unknown Source)
    1 frame
  3. org.pentaho.di
    StepInitThread.run
    1. org.pentaho.di.core.database.Database.execStatements(Database.java:1598)
    2. org.pentaho.di.trans.steps.sql.ExecSQL.init(ExecSQL.java:280)
    3. org.pentaho.di.trans.step.StepInitThread.run(StepInitThread.java:48)
    3 frames
  4. Java RT
    Thread.run
    1. java.lang.Thread.run(Unknown Source)
    1 frame