java.lang.StringIndexOutOfBoundsException

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
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.

  • hdm2java generating .java files (reverse engineering from database) Throws java.lang.StringIndexOutOfBoundsException when I try to connect large schemas from Informix Databse. (Tests with few tables works fine.) BUILD FAILED C:\eclipse33\hibernate_ant\build.xml:23: java.lang.StringIndexOutOfBoundsException: String index out of range: 256 at org.hibernate.tool.ant.HibernateToolTask.reportException(HibernateToolTask.java:226) at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:189) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) 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:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329) at org.apache.tools.ant.Project.executeTarget(Project.java:1298) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1181) at org.apache.tools.ant.Main.runBuild(Main.java:698) at org.apache.tools.ant.Main.startAnt(Main.java:199) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104) Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 256 at java.lang.String.charAt(String.java:687) at com.informix.jdbc.IfxDatabaseMetaData.getColumns(IfxDatabaseMetaData.java:3457) at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getColumns(JDBCMetaDataDialect.java:124) at org.hibernate.cfg.reveng.JDBCReader.processBasicColumns(JDBCReader.java:555) at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:85) at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:837) at org.hibernate.cfg.JDBCBinder.readDatabaseSchema(JDBCBinder.java:115) at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:88) at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:40) at org.hibernate.tool.ant.JDBCConfigurationTask.doConfiguration(JDBCConfigurationTask.java:81) at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:55) at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:302) at org.hibernate.tool.ant.HibernateToolTask.getProperties(HibernateToolTask.java:318) at org.hibernate.tool.ant.ExporterTask.configureExporter(ExporterTask.java:94) at org.hibernate.tool.ant.Hbm2JavaExporterTask.configureExporter(Hbm2JavaExporterTask.java:34) at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39) at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:186) ... 17 more --- Nested Exception --- java.lang.StringIndexOutOfBoundsException: String index out of range: 256 at java.lang.String.charAt(String.java:687) at com.informix.jdbc.IfxDatabaseMetaData.getColumns(IfxDatabaseMetaData.java:3457) at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getColumns(JDBCMetaDataDialect.java:124) at org.hibernate.cfg.reveng.JDBCReader.processBasicColumns(JDBCReader.java:555) at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:85) at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:837) at org.hibernate.cfg.JDBCBinder.readDatabaseSchema(JDBCBinder.java:115) at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:88) at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:40) at org.hibernate.tool.ant.JDBCConfigurationTask.doConfiguration(JDBCConfigurationTask.java:81) at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:55) at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:302) at org.hibernate.tool.ant.HibernateToolTask.getProperties(HibernateToolTask.java:318) at org.hibernate.tool.ant.ExporterTask.configureExporter(ExporterTask.java:94) at org.hibernate.tool.ant.Hbm2JavaExporterTask.configureExporter(Hbm2JavaExporterTask.java:34) at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39) at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:186) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) 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:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329) at org.apache.tools.ant.Project.executeTarget(Project.java:1298) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1181) at org.apache.tools.ant.Main.runBuild(Main.java:698) at org.apache.tools.ant.Main.startAnt(Main.java:199) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
    via by Sebastiao Gazolla C Jr,
  • hdm2java generating .java files (reverse engineering from database) Throws java.lang.StringIndexOutOfBoundsException when I try to connect large schemas from Informix Databse. (Tests with few tables works fine.) BUILD FAILED C:\eclipse33\hibernate_ant\build.xml:23: java.lang.StringIndexOutOfBoundsException: String index out of range: 256 at org.hibernate.tool.ant.HibernateToolTask.reportException(HibernateToolTask.java:226) at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:189) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) 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:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329) at org.apache.tools.ant.Project.executeTarget(Project.java:1298) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1181) at org.apache.tools.ant.Main.runBuild(Main.java:698) at org.apache.tools.ant.Main.startAnt(Main.java:199) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104) Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 256 at java.lang.String.charAt(String.java:687) at com.informix.jdbc.IfxDatabaseMetaData.getColumns(IfxDatabaseMetaData.java:3457) at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getColumns(JDBCMetaDataDialect.java:124) at org.hibernate.cfg.reveng.JDBCReader.processBasicColumns(JDBCReader.java:555) at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:85) at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:837) at org.hibernate.cfg.JDBCBinder.readDatabaseSchema(JDBCBinder.java:115) at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:88) at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:40) at org.hibernate.tool.ant.JDBCConfigurationTask.doConfiguration(JDBCConfigurationTask.java:81) at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:55) at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:302) at org.hibernate.tool.ant.HibernateToolTask.getProperties(HibernateToolTask.java:318) at org.hibernate.tool.ant.ExporterTask.configureExporter(ExporterTask.java:94) at org.hibernate.tool.ant.Hbm2JavaExporterTask.configureExporter(Hbm2JavaExporterTask.java:34) at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39) at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:186) ... 17 more --- Nested Exception --- java.lang.StringIndexOutOfBoundsException: String index out of range: 256 at java.lang.String.charAt(String.java:687) at com.informix.jdbc.IfxDatabaseMetaData.getColumns(IfxDatabaseMetaData.java:3457) at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getColumns(JDBCMetaDataDialect.java:124) at org.hibernate.cfg.reveng.JDBCReader.processBasicColumns(JDBCReader.java:555) at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:85) at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:837) at org.hibernate.cfg.JDBCBinder.readDatabaseSchema(JDBCBinder.java:115) at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:88) at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:40) at org.hibernate.tool.ant.JDBCConfigurationTask.doConfiguration(JDBCConfigurationTask.java:81) at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:55) at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:302) at org.hibernate.tool.ant.HibernateToolTask.getProperties(HibernateToolTask.java:318) at org.hibernate.tool.ant.ExporterTask.configureExporter(ExporterTask.java:94) at org.hibernate.tool.ant.Hbm2JavaExporterTask.configureExporter(Hbm2JavaExporterTask.java:34) at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39) at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:186) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) 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:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329) at org.apache.tools.ant.Project.executeTarget(Project.java:1298) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1181) at org.apache.tools.ant.Main.runBuild(Main.java:698) at org.apache.tools.ant.Main.startAnt(Main.java:199) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
    via by Sebastiao Gazolla C Jr,
  • String index out of range: -1 Error.
    via by Unknown author,
    • java.lang.StringIndexOutOfBoundsException: String index out of range: 256 at org.hibernate.tool.ant.HibernateToolTask.reportException(HibernateToolTask.java:226) at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:189) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) 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:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329) at org.apache.tools.ant.Project.executeTarget(Project.java:1298) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1181) at org.apache.tools.ant.Main.runBuild(Main.java:698) at org.apache.tools.ant.Main.startAnt(Main.java:199) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104) Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 256 at java.lang.String.charAt(String.java:687) at com.informix.jdbc.IfxDatabaseMetaData.getColumns(IfxDatabaseMetaData.java:3457) at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getColumns(JDBCMetaDataDialect.java:124) at org.hibernate.cfg.reveng.JDBCReader.processBasicColumns(JDBCReader.java:555) at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:85) at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:837) at org.hibernate.cfg.JDBCBinder.readDatabaseSchema(JDBCBinder.java:115) at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:88) at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:40) at org.hibernate.tool.ant.JDBCConfigurationTask.doConfiguration(JDBCConfigurationTask.java:81) at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:55) at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:302) at org.hibernate.tool.ant.HibernateToolTask.getProperties(HibernateToolTask.java:318) at org.hibernate.tool.ant.ExporterTask.configureExporter(ExporterTask.java:94) at org.hibernate.tool.ant.Hbm2JavaExporterTask.configureExporter(Hbm2JavaExporterTask.java:34) at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39) at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:186) ... 17 more

    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,
    30 more bugmates