java.lang.StringIndexOutOfBoundsException

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.


rafael

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • Download a file using FTP
    via by 843797,
  • Clover-for-Grails generates an exception when using the -clover.view option on the Grails command line. According to Nick's assessment so far, this is a Windows-specific problem. See output below: {noformat} C:\grails-1.2.1\samples\petclinic>grails test-app -clover.on -clover.view Welcome to Grails 1.2.1 - http://grails.org/ Licensed under Apache Standard License 2.0 Grails home is set to: C:\grails-1.2.1 Base Directory: C:\grails-1.2.1\samples\petclinic Resolving dependencies... Dependencies resolved in 2641ms. Running script C:\grails-1.2.1\scripts\TestApp.groovy Environment set to test Clover: Using config: [on:true, view:true] Using clover license path: C:\Documents and Settings\Giles Gaskell\.grails\1.2.1\projects\petclinic\plugins\clover-0.2\grails-app\conf\clover\clover-evaluation. license [clover-env] Loading clover.xml: jar:file:/C:/Documents%20and%20Settings/Giles%20Gaskell/.ivy2/cache/com.cenqua.clover/clover/jars/clover-3.0.0-m3.jar!/clover.x ml Using default clover-setup configuration. Clover: directories: [src/java, src/groovy, test, grails-app] includes: [**/*.groovy, **/*.java] excludes [**/conf/**, **/plugins/**] [clover-setup] Clover Version 3.0.0-m3, built on February 26 2010 (build-780) [clover-setup] Loaded from: C:\Documents and Settings\Giles Gaskell\.ivy2\cache\com.cenqua.clover\clover\jars\clover-3.0.0-m3.jar [clover-setup] Clover Evaluation License registered to Clover Grails Plugin. [clover-setup] You have 23 day(s) before your license expires. [clover-setup] Clover is enabled with initstring 'C:\Documents and Settings\Giles Gaskell\.grails\1.2.1\projects\petclinic\clover\db\clover.db' Clover: Forcing a clean to ensure Clover instrumentation occurs. Disable by setting: clover.forceClean=false [delete] Deleting directory C:\grails-1.2.1\samples\petclinic\target\classes [delete] Deleting directory C:\grails-1.2.1\samples\petclinic\target\test-classes [delete] Deleting directory C:\Documents and Settings\Giles Gaskell\.grails\1.2.1\projects\petclinic\clover Clover: Compile start. [mkdir] Created dir: C:\grails-1.2.1\samples\petclinic\target\classes [groovyc] Compiling 2 source files to C:\grails-1.2.1\samples\petclinic\target\classes [clover-setup] Creating new database at 'C:\Documents and Settings\Giles Gaskell\.grails\1.2.1\projects\petclinic\clover\db\clover.db'. [groovyc] Compiling 17 source files to C:\grails-1.2.1\samples\petclinic\target\classes [clover-setup] Creating new database at 'C:\Documents and Settings\Giles Gaskell\.grails\1.2.1\projects\petclinic\clover\db\clover.db'. [mkdir] Created dir: C:\grails-1.2.1\samples\petclinic\target\test-reports\html [mkdir] Created dir: C:\grails-1.2.1\samples\petclinic\target\test-reports\plain Starting unit test phase ... [mkdir] Created dir: C:\grails-1.2.1\samples\petclinic\target\test-classes\unit [groovyc] Compiling 1 source file to C:\grails-1.2.1\samples\petclinic\target\test-classes\unit [clover-setup] Updating existing database at 'C:\Documents and Settings\Giles Gaskell\.grails\1.2.1\projects\petclinic\clover\db\clover.db'. ------------------------------------------------------- Running 1 unit test... Running test org.grails.samples.OwnerControllerTests...PASSED Tests Completed in 2015ms ... ------------------------------------------------------- Tests passed: 6 Tests failed: 0 ------------------------------------------------------- Starting integration test phase ... [copy] Copying 1 file to C:\grails-1.2.1\samples\petclinic\target\test-classes\integration [copy] Copying 1 file to C:\grails-1.2.1\samples\petclinic\target\test-classes [copy] Copied 3 empty directories to 2 empty directories under C:\grails-1.2.1\samples\petclinic\target\test-classes Clover: Compile start. [groovyc] Compiling 1 source file to C:\grails-1.2.1\samples\petclinic\target\classes [clover-setup] Updating existing database at 'C:\Documents and Settings\Giles Gaskell\.grails\1.2.1\projects\petclinic\clover\db\clover.db'. [copy] Copying 1 file to C:\grails-1.2.1\samples\petclinic\target\classes Clover: Compile start. [groovyc] Compiling 1 source file to C:\grails-1.2.1\samples\petclinic\target\classes [clover-setup] Updating existing database at 'C:\Documents and Settings\Giles Gaskell\.grails\1.2.1\projects\petclinic\clover\db\clover.db'. [junitreport] Processing C:\grails-1.2.1\samples\petclinic\target\test-reports\TESTS-TestSuites.xml to C:\DOCUME~1\GILESG~1\LOCALS~1\Temp\null1750708552 [junitreport] Loading stylesheet jar:file:/C:/Documents%20and%20Settings/Giles%20Gaskell/.ivy2/cache/org.apache.ant/ant-junit/jars/ant-junit-1.7.1.jar!/org/apac he/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl [junitreport] Transform time: 735ms [junitreport] Deleting: C:\DOCUME~1\GILESG~1\LOCALS~1\Temp\null1750708552 Tests PASSED - view reports in target\test-reports Clover: Tests ended [clover-historypoint] Clover Version 3.0.0-m3, built on February 26 2010 (build-780) [clover-historypoint] Loaded from: C:\Documents and Settings\Giles Gaskell\.ivy2\cache\com.cenqua.clover\clover\jars\clover-3.0.0-m3.jar [clover-historypoint] Clover Evaluation License registered to Clover Grails Plugin. [clover-historypoint] You have 23 day(s) before your license expires. [clover-historypoint] Writing report to 'C:\grails-1.2.1\samples\petclinic\.cloverhistory\clover-20100305112533.xml.gz' [clover-html-report] Clover Version 3.0.0-m3, built on February 26 2010 (build-780) [clover-html-report] Loaded from: C:\Documents and Settings\Giles Gaskell\.ivy2\cache\com.cenqua.clover\clover\jars\clover-3.0.0-m3.jar [clover-html-report] Clover Evaluation License registered to Clover Grails Plugin. [clover-html-report] You have 23 day(s) before your license expires. [clover-html-report] Not overwriting existing history point 'C:\grails-1.2.1\samples\petclinic\.cloverhistory\clover-20100305112533.xml.gz'. To force, set overw rite="true". [clover-html-report] Loading coverage database from: 'C:\Documents and Settings\Giles Gaskell\.grails\1.2.1\projects\petclinic\clover\db\clover.db' [clover-html-report] Loading historical coverage data from: 'C:\grails-1.2.1\samples\petclinic\.cloverhistory' [clover-html-report] Writing HTML report to 'C:\grails-1.2.1\samples\petclinic\build\clover\report' [clover-html-report] Done. Processed 1 packages in 3047ms (3047ms per package). [clover-html-report] Writing historical report to 'C:\grails-1.2.1\samples\petclinic\build\clover\report' [clover-html-report] Read 3 history points. [clover-html-report] using movers interval of 18 hours [clover-html-report] using movers interval of 18 hours [clover-html-report] Writing JSON historical-data to: C:\grails-1.2.1\samples\petclinic\build\clover\report\historical-json.js [clover-html-report] Done. Error executing script TestApp: java.lang.StringIndexOutOfBoundsException: String index out of range: 1 gant.TargetExecutionException: java.lang.StringIndexOutOfBoundsException: String index out of range: 1 at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:331) at gant.Gant$_dispatch_closure6.doCall(Gant.groovy:334) at gant.Gant$_dispatch_closure6.doCall(Gant.groovy) at gant.Gant.withBuildListeners(Gant.groovy:344) at gant.Gant.this$2$withBuildListeners(Gant.groovy) at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source) at gant.Gant.dispatch(Gant.groovy:334) at gant.Gant.this$2$dispatch(Gant.groovy) at gant.Gant.invokeMethod(Gant.groovy) at gant.Gant.processTargets(Gant.groovy:495) at gant.Gant.processTargets(Gant.groovy:480) Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 1 at java.lang.String.charAt(String.java:687) at java.util.regex.Matcher.appendReplacement(Matcher.java:703) at java.util.regex.Matcher.replaceAll(Matcher.java:813) at java.lang.String.replaceAll(String.java:2190) at _Events.launchReport(_Events.groovy:138) at _Events$_run_closure6.doCall(_Events.groovy:108) at _GrailsEvents_groovy$_run_closure5.doCall(_GrailsEvents_groovy:58) at _GrailsEvents_groovy$_run_closure5.call(_GrailsEvents_groovy) at _GrailsTest_groovy$_run_closure1.doCall(_GrailsTest_groovy:214) at TestApp$_run_closure1.doCall(TestApp.groovy:102) at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:324) ... 10 more Error executing script TestApp: java.lang.StringIndexOutOfBoundsException: String index out of range: 1 Application context shutting down... Application context shutdown. {noformat}
    via by Giles Gaskell [Atlassian],
  • CLOB in BI Publisher Reports
    via by Guest_0607,
  • IOOBE
    via GitHub by meysholdt
    ,
    • java.lang.StringIndexOutOfBoundsException: String index out of range: 3 at java.lang.String.charAt(Unknown Source) at sun.net.ftp.FtpClient.login(Unknown Source) at TestFtp.main(TestFtp.java:21)

    Users with the same issue

    poroszd
    12 times, last one,
    olle.hallin
    1 times, last one,
    linxiaolong
    1 times, last one,
    jokester
    1 times, last one,
    tyson925
    1 times, last one,
    27 more bugmates