java.lang.StringIndexOutOfBoundsException: String index out of range: -1

Spring JIRA | René Buffat | 6 years ago
  1. 0

    adding a float type field leads to exception "String index out of range: -1" in gwt setup Step to reproduce: persistence setup --provider DATANUCLEUS --database HYPERSONIC_IN_MEMORY entity --class ~.server.domain.Test --testAutomatically field number --fieldName aFloat --type java.lang.Float gwt setup Error message: java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1937) at org.springframework.roo.addon.gwt.GwtMetadata.buildDataDictionary(GwtMetadata.java:580) at org.springframework.roo.addon.gwt.GwtMetadata.buildActivitiesMapper(GwtMetadata.java:248) at org.springframework.roo.addon.gwt.GwtMetadata.<init>(GwtMetadata.java:123) at org.springframework.roo.addon.gwt.GwtMetadataProvider.get(GwtMetadataProvider.java:130) at org.springframework.roo.metadata.DefaultMetadataService.get(DefaultMetadataService.java:128) at org.springframework.roo.metadata.DefaultMetadataService.get(DefaultMetadataService.java:147) at org.springframework.roo.addon.gwt.GwtOperationsImpl.setupGwt(GwtOperationsImpl.java:143) at org.springframework.roo.addon.gwt.GwtCommands.installSecurity(GwtCommands.java:28) 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.springframework.roo.support.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:191) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(ProcessManagerHostedExecutionStrategy.java:49) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:177) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:140) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:47) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:159) at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:327) at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:120) at java.lang.Thread.run(Thread.java:619)

    Spring JIRA | 6 years ago | René Buffat
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
  2. 0

    adding a float type field leads to exception "String index out of range: -1" in gwt setup Step to reproduce: persistence setup --provider DATANUCLEUS --database HYPERSONIC_IN_MEMORY entity --class ~.server.domain.Test --testAutomatically field number --fieldName aFloat --type java.lang.Float gwt setup Error message: java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1937) at org.springframework.roo.addon.gwt.GwtMetadata.buildDataDictionary(GwtMetadata.java:580) at org.springframework.roo.addon.gwt.GwtMetadata.buildActivitiesMapper(GwtMetadata.java:248) at org.springframework.roo.addon.gwt.GwtMetadata.<init>(GwtMetadata.java:123) at org.springframework.roo.addon.gwt.GwtMetadataProvider.get(GwtMetadataProvider.java:130) at org.springframework.roo.metadata.DefaultMetadataService.get(DefaultMetadataService.java:128) at org.springframework.roo.metadata.DefaultMetadataService.get(DefaultMetadataService.java:147) at org.springframework.roo.addon.gwt.GwtOperationsImpl.setupGwt(GwtOperationsImpl.java:143) at org.springframework.roo.addon.gwt.GwtCommands.installSecurity(GwtCommands.java:28) 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.springframework.roo.support.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:191) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(ProcessManagerHostedExecutionStrategy.java:49) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:177) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:140) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:47) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:159) at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:327) at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:120) at java.lang.Thread.run(Thread.java:619)

    Spring JIRA | 6 years ago | René Buffat
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Including the following field in a Roo gwt app: field number --fieldName weight --type java.lang.Float --notNull --min 0 Getting this exception during codegen: String index out of range: -1 java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1949) at org.springframework.roo.addon.gwt.GwtMetadata.buildDataDictionary(GwtMetadata.java:434) at org.springframework.roo.addon.gwt.GwtMetadata.buildActivitiesMapper(GwtMetadata.java:145) at org.springframework.roo.addon.gwt.GwtMetadata.<init>(GwtMetadata.java:102) at org.springframework.roo.addon.gwt.GwtMetadataProvider.get(GwtMetadataProvider.java:131) at org.springframework.roo.metadata.DefaultMetadataService.get(DefaultMetadataService.java:139) at org.springframework.roo.metadata.DefaultMetadataService.get(DefaultMetadataService.java:159) at org.springframework.roo.addon.gwt.GwtOperationsImpl.setupGwt(GwtOperationsImpl.java:140) at org.springframework.roo.addon.gwt.GwtCommands.installSecurity(GwtCommands.java:28) Please wait - still loading at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Met [org.springframework.roo.process.manager [54]] ServiceEvent UNREGISTERING at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.springframework.roo.support.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:191) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(ProcessManagerHostedExecutionStrategy.java:49) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:177) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:140) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:47) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:161) at org.springframework.roo.shell.AbstractShell.executeScriptLine(AbstractShell.java:103) at org.springframework.roo.shell.AbstractShell.script(AbstractShell.java:83) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.springframework.roo.support.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:191) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(ProcessManagerHostedExecutionStrategy.java:49) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:177) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:140) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:47) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:161) at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:109) at java.lang.Thread.run(Thread.java:636) Script execution aborted java.lang.IllegalStateException: Script execution aborted at org.springframework.roo.shell.AbstractShell.script(AbstractShell.java:86) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.springframework.roo.support.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:191) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(ProcessManagerHostedExecutionStrategy.java:49) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:177) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:140) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:47) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:161) at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:109) at java.lang.Thread.run(Thread.java:636)

    Spring JIRA | 6 years ago | Stephanie Brubaker
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
  5. 0

    Including the following field in a Roo gwt app: field number --fieldName weight --type java.lang.Float --notNull --min 0 Getting this exception during codegen: String index out of range: -1 java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1949) at org.springframework.roo.addon.gwt.GwtMetadata.buildDataDictionary(GwtMetadata.java:434) at org.springframework.roo.addon.gwt.GwtMetadata.buildActivitiesMapper(GwtMetadata.java:145) at org.springframework.roo.addon.gwt.GwtMetadata.<init>(GwtMetadata.java:102) at org.springframework.roo.addon.gwt.GwtMetadataProvider.get(GwtMetadataProvider.java:131) at org.springframework.roo.metadata.DefaultMetadataService.get(DefaultMetadataService.java:139) at org.springframework.roo.metadata.DefaultMetadataService.get(DefaultMetadataService.java:159) at org.springframework.roo.addon.gwt.GwtOperationsImpl.setupGwt(GwtOperationsImpl.java:140) at org.springframework.roo.addon.gwt.GwtCommands.installSecurity(GwtCommands.java:28) Please wait - still loading at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Met [org.springframework.roo.process.manager [54]] ServiceEvent UNREGISTERING at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.springframework.roo.support.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:191) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(ProcessManagerHostedExecutionStrategy.java:49) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:177) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:140) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:47) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:161) at org.springframework.roo.shell.AbstractShell.executeScriptLine(AbstractShell.java:103) at org.springframework.roo.shell.AbstractShell.script(AbstractShell.java:83) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.springframework.roo.support.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:191) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(ProcessManagerHostedExecutionStrategy.java:49) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:177) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:140) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:47) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:161) at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:109) at java.lang.Thread.run(Thread.java:636) Script execution aborted java.lang.IllegalStateException: Script execution aborted at org.springframework.roo.shell.AbstractShell.script(AbstractShell.java:86) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.springframework.roo.support.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:191) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(ProcessManagerHostedExecutionStrategy.java:49) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:177) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:140) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:47) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:161) at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:109) at java.lang.Thread.run(Thread.java:636)

    Spring JIRA | 6 years ago | Stephanie Brubaker
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
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: -1

    at java.lang.String.substring()
  2. Java RT
    String.substring
    1. java.lang.String.substring(String.java:1937)
    1 frame
  3. Spring Roo - Annotations (ASLv2 Licensed)
    GwtMetadataProvider.get
    1. org.springframework.roo.addon.gwt.GwtMetadata.buildDataDictionary(GwtMetadata.java:580)
    2. org.springframework.roo.addon.gwt.GwtMetadata.buildActivitiesMapper(GwtMetadata.java:248)
    3. org.springframework.roo.addon.gwt.GwtMetadata.<init>(GwtMetadata.java:123)
    4. org.springframework.roo.addon.gwt.GwtMetadataProvider.get(GwtMetadataProvider.java:130)
    4 frames
  4. org.springframework.roo
    DefaultMetadataService.get
    1. org.springframework.roo.metadata.DefaultMetadataService.get(DefaultMetadataService.java:128)
    2. org.springframework.roo.metadata.DefaultMetadataService.get(DefaultMetadataService.java:147)
    2 frames
  5. Spring Roo - Annotations (ASLv2 Licensed)
    GwtCommands.installSecurity
    1. org.springframework.roo.addon.gwt.GwtOperationsImpl.setupGwt(GwtOperationsImpl.java:143)
    2. org.springframework.roo.addon.gwt.GwtCommands.installSecurity(GwtCommands.java:28)
    2 frames
  6. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    4. java.lang.reflect.Method.invoke(Method.java:597)
    4 frames
  7. org.springframework.roo
    JLineShell.run
    1. org.springframework.roo.support.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:191)
    2. org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(ProcessManagerHostedExecutionStrategy.java:49)
    3. org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:177)
    4. org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:140)
    5. org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:47)
    6. org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:159)
    7. org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:327)
    8. org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:120)
    8 frames
  8. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:619)
    1 frame