java.lang.IndexOutOfBoundsException: Index: 1, Size: 1

Spring JIRA | Juan Carlos García del Canto | 2 years ago
  1. 0

    Trying to execute the following script: {code} // Project creation project --topLevelPackage org.springframework.roo.test // Database configuration (PostgreSQL) jpa setup --provider HIBERNATE --database POSTGRES --databaseName rooDB --userName admin --password admin // DATA MODEL GENERATION // GeoBoundaryRelationType enum type --class ~.domain.enumerated.GeoBoundaryRelationType enum constant --name MUNICIPIO // HousingType enum type --class ~.domain.enumerated.HousingType enum constant --name COBRA enum constant --name NINGUNO enum constant --name PAGA //Entities entity jpa --class ~.domain.Location --identifierField id --abstract --inheritanceType JOINED entity jpa --class ~.domain.place.Place --extends ~.domain.Location --testAutomatically // GeographicBoundaryRelationship entity jpa --class ~.domain.GeographicBoundary --identifierField id --testAutomatically entity jpa --class ~.domain.GeographicBoundaryRelationship --identifierField id --testAutomatically field enum --fieldName type --type ~.domain.enumerated.GeoBoundaryRelationType --notNull --enumType STRING field reference --fieldName fromGeographicBoundary --type ~.domain.GeographicBoundary --cardinality MANY_TO_ONE --notNull field reference --fieldName toGeographicBoundary --type ~.domain.GeographicBoundary --cardinality MANY_TO_ONE --notNull // GeographicBoundary focus --class ~.domain.GeographicBoundary field string --fieldName name --notNull field string --fieldName nameWithoutAccents field set --fieldName relationshipChildren --type ~.domain.GeographicBoundaryRelationship --cardinality ONE_TO_MANY --mappedBy fromGeographicBoundary field set --fieldName relationshipParents --type ~.domain.GeographicBoundaryRelationship --cardinality ONE_TO_MANY --mappedBy toGeographicBoundary // Location focus --class ~.domain.Location field string --fieldName name --notNull field reference --fieldName province --type ~.domain.GeographicBoundary --cardinality MANY_TO_ONE --notNull field reference --fieldName city --type ~.domain.GeographicBoundary --cardinality MANY_TO_ONE --notNull field string --fieldName address --notNull // Place focus --class ~.domain.place.Place field boolean --fieldName operational --notNull --primitive field boolean --fieldName shared --notNull --primitive field enum --fieldName housing --type ~.domain.enumerated.HousingType --notNull --enumType STRING field string --fieldName notes // Web layout (Spring MVC) web mvc setup // Web Mvc Scaffold web mvc scaffold --backingType ~.domain.place.Place --class ~.web.place.PlaceController {code} When script finish appears the following error: {code} Script execution aborted Index: 1, Size: 1 {code} Activating {{development mode}} on Roo Shell appears the following log error: {code} Index: 1, Size: 1 java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 at java.util.ArrayList.RangeCheck(ArrayList.java:547) at java.util.ArrayList.get(ArrayList.java:322) at org.springframework.roo.addon.web.mvc.controller.scaffold.WebScaffoldMetadata.getCreateFormMethod(WebScaffoldMetadata.java:377) at org.springframework.roo.addon.web.mvc.controller.scaffold.WebScaffoldMetadata.<init>(WebScaffoldMetadata.java:170) at org.springframework.roo.addon.web.mvc.controller.scaffold.WebScaffoldMetadataProviderImpl.getMetadata(WebScaffoldMetadataProviderImpl.java:190) at org.springframework.roo.classpath.itd.AbstractItdMetadataProvider.get(AbstractItdMetadataProvider.java:264) at org.springframework.roo.metadata.DefaultMetadataService.getInternal(DefaultMetadataService.java:212) at org.springframework.roo.metadata.DefaultMetadataService.evictAndGet(DefaultMetadataService.java:121) at org.springframework.roo.classpath.itd.AbstractItdMetadataProvider.notify(AbstractItdMetadataProvider.java:601) at org.springframework.roo.metadata.DefaultMetadataService.notify(DefaultMetadataService.java:325) at org.springframework.roo.metadata.internal.DefaultMetadataDependencyRegistry.notifyDownstream(DefaultMetadataDependencyRegistry.java:238) at org.springframework.roo.classpath.DefaultPhysicalTypeMetadataProvider.onFileEvent(DefaultPhysicalTypeMetadataProvider.java:250) at org.springframework.roo.file.monitor.polling.PollingFileMonitorService.publish(PollingFileMonitorService.java:433) at org.springframework.roo.file.monitor.polling.PollingFileMonitorService.publishRequestedFileEvents(PollingFileMonitorService.java:456) at org.springframework.roo.file.monitor.polling.PollingFileMonitorService.scanNotified(PollingFileMonitorService.java:660) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:335) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:71) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:44) at org.springframework.roo.shell.AbstractShell.executeCommandImpl(AbstractShell.java:242) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:149) at org.springframework.roo.shell.AbstractShell.executeScriptLine(AbstractShell.java:298) at org.springframework.roo.shell.AbstractShell.script(AbstractShell.java:521) 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.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(ProcessManagerHostedExecutionStrategy.java:47) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:325) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:71) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:44) at org.springframework.roo.shell.AbstractShell.executeCommandImpl(AbstractShell.java:242) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:149) at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:421) at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:539) {code} Debugging WebScaffoldMetadata seems like {{dependentTypes}} is getting parent class references too, but on {{fieldNamesList}} are only registered the extended class fields... dependentTypes size is 2 and fieldNamesList size is 1 so, when method tries to get fieldNamesList position 1 is showing an {{IndexOutOfBounds}} exception.

    Spring JIRA | 2 years ago | Juan Carlos García del Canto
    java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
  2. 0

    Trying to execute the following script: {code} // Project creation project --topLevelPackage org.springframework.roo.test // Database configuration (PostgreSQL) jpa setup --provider HIBERNATE --database POSTGRES --databaseName rooDB --userName admin --password admin // DATA MODEL GENERATION // GeoBoundaryRelationType enum type --class ~.domain.enumerated.GeoBoundaryRelationType enum constant --name MUNICIPIO // HousingType enum type --class ~.domain.enumerated.HousingType enum constant --name COBRA enum constant --name NINGUNO enum constant --name PAGA //Entities entity jpa --class ~.domain.Location --identifierField id --abstract --inheritanceType JOINED entity jpa --class ~.domain.place.Place --extends ~.domain.Location --testAutomatically // GeographicBoundaryRelationship entity jpa --class ~.domain.GeographicBoundary --identifierField id --testAutomatically entity jpa --class ~.domain.GeographicBoundaryRelationship --identifierField id --testAutomatically field enum --fieldName type --type ~.domain.enumerated.GeoBoundaryRelationType --notNull --enumType STRING field reference --fieldName fromGeographicBoundary --type ~.domain.GeographicBoundary --cardinality MANY_TO_ONE --notNull field reference --fieldName toGeographicBoundary --type ~.domain.GeographicBoundary --cardinality MANY_TO_ONE --notNull // GeographicBoundary focus --class ~.domain.GeographicBoundary field string --fieldName name --notNull field string --fieldName nameWithoutAccents field set --fieldName relationshipChildren --type ~.domain.GeographicBoundaryRelationship --cardinality ONE_TO_MANY --mappedBy fromGeographicBoundary field set --fieldName relationshipParents --type ~.domain.GeographicBoundaryRelationship --cardinality ONE_TO_MANY --mappedBy toGeographicBoundary // Location focus --class ~.domain.Location field string --fieldName name --notNull field reference --fieldName province --type ~.domain.GeographicBoundary --cardinality MANY_TO_ONE --notNull field reference --fieldName city --type ~.domain.GeographicBoundary --cardinality MANY_TO_ONE --notNull field string --fieldName address --notNull // Place focus --class ~.domain.place.Place field boolean --fieldName operational --notNull --primitive field boolean --fieldName shared --notNull --primitive field enum --fieldName housing --type ~.domain.enumerated.HousingType --notNull --enumType STRING field string --fieldName notes // Web layout (Spring MVC) web mvc setup // Web Mvc Scaffold web mvc scaffold --backingType ~.domain.place.Place --class ~.web.place.PlaceController {code} When script finish appears the following error: {code} Script execution aborted Index: 1, Size: 1 {code} Activating {{development mode}} on Roo Shell appears the following log error: {code} Index: 1, Size: 1 java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 at java.util.ArrayList.RangeCheck(ArrayList.java:547) at java.util.ArrayList.get(ArrayList.java:322) at org.springframework.roo.addon.web.mvc.controller.scaffold.WebScaffoldMetadata.getCreateFormMethod(WebScaffoldMetadata.java:377) at org.springframework.roo.addon.web.mvc.controller.scaffold.WebScaffoldMetadata.<init>(WebScaffoldMetadata.java:170) at org.springframework.roo.addon.web.mvc.controller.scaffold.WebScaffoldMetadataProviderImpl.getMetadata(WebScaffoldMetadataProviderImpl.java:190) at org.springframework.roo.classpath.itd.AbstractItdMetadataProvider.get(AbstractItdMetadataProvider.java:264) at org.springframework.roo.metadata.DefaultMetadataService.getInternal(DefaultMetadataService.java:212) at org.springframework.roo.metadata.DefaultMetadataService.evictAndGet(DefaultMetadataService.java:121) at org.springframework.roo.classpath.itd.AbstractItdMetadataProvider.notify(AbstractItdMetadataProvider.java:601) at org.springframework.roo.metadata.DefaultMetadataService.notify(DefaultMetadataService.java:325) at org.springframework.roo.metadata.internal.DefaultMetadataDependencyRegistry.notifyDownstream(DefaultMetadataDependencyRegistry.java:238) at org.springframework.roo.classpath.DefaultPhysicalTypeMetadataProvider.onFileEvent(DefaultPhysicalTypeMetadataProvider.java:250) at org.springframework.roo.file.monitor.polling.PollingFileMonitorService.publish(PollingFileMonitorService.java:433) at org.springframework.roo.file.monitor.polling.PollingFileMonitorService.publishRequestedFileEvents(PollingFileMonitorService.java:456) at org.springframework.roo.file.monitor.polling.PollingFileMonitorService.scanNotified(PollingFileMonitorService.java:660) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:335) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:71) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:44) at org.springframework.roo.shell.AbstractShell.executeCommandImpl(AbstractShell.java:242) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:149) at org.springframework.roo.shell.AbstractShell.executeScriptLine(AbstractShell.java:298) at org.springframework.roo.shell.AbstractShell.script(AbstractShell.java:521) 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.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(ProcessManagerHostedExecutionStrategy.java:47) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:325) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:71) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:44) at org.springframework.roo.shell.AbstractShell.executeCommandImpl(AbstractShell.java:242) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:149) at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:421) at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:539) {code} Debugging WebScaffoldMetadata seems like {{dependentTypes}} is getting parent class references too, but on {{fieldNamesList}} are only registered the extended class fields... dependentTypes size is 2 and fieldNamesList size is 1 so, when method tries to get fieldNamesList position 1 is showing an {{IndexOutOfBounds}} exception.

    Spring JIRA | 2 years ago | Juan Carlos García del Canto
    java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
  3. 0

    deleting map in a list then editing another map throws exception

    https://bugzilla.redhat.com/bugzilla/ | 8 years ago | John Mazzitelli
    java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    java.lang.IndexOutOfBoundsException: Index: 1, Size: 1

    GitHub | 3 years ago | wangxianbin1987
    java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
  6. 0

    Problems with Finding the Longest word in a Data File

    Stack Overflow | 3 years ago | Beginning Java
    java.lang.IndexOutOfBoundsException: Index: 1, Size: 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.IndexOutOfBoundsException

    Index: 1, Size: 1

    at java.util.ArrayList.RangeCheck()
  2. Java RT
    ArrayList.get
    1. java.util.ArrayList.RangeCheck(ArrayList.java:547)
    2. java.util.ArrayList.get(ArrayList.java:322)
    2 frames
  3. Spring Roo - Annotations (ASLv2 Licensed)
    WebScaffoldMetadataProviderImpl.getMetadata
    1. org.springframework.roo.addon.web.mvc.controller.scaffold.WebScaffoldMetadata.getCreateFormMethod(WebScaffoldMetadata.java:377)
    2. org.springframework.roo.addon.web.mvc.controller.scaffold.WebScaffoldMetadata.<init>(WebScaffoldMetadata.java:170)
    3. org.springframework.roo.addon.web.mvc.controller.scaffold.WebScaffoldMetadataProviderImpl.getMetadata(WebScaffoldMetadataProviderImpl.java:190)
    3 frames
  4. org.springframework.roo
    AbstractShell.script
    1. org.springframework.roo.classpath.itd.AbstractItdMetadataProvider.get(AbstractItdMetadataProvider.java:264)
    2. org.springframework.roo.metadata.DefaultMetadataService.getInternal(DefaultMetadataService.java:212)
    3. org.springframework.roo.metadata.DefaultMetadataService.evictAndGet(DefaultMetadataService.java:121)
    4. org.springframework.roo.classpath.itd.AbstractItdMetadataProvider.notify(AbstractItdMetadataProvider.java:601)
    5. org.springframework.roo.metadata.DefaultMetadataService.notify(DefaultMetadataService.java:325)
    6. org.springframework.roo.metadata.internal.DefaultMetadataDependencyRegistry.notifyDownstream(DefaultMetadataDependencyRegistry.java:238)
    7. org.springframework.roo.classpath.DefaultPhysicalTypeMetadataProvider.onFileEvent(DefaultPhysicalTypeMetadataProvider.java:250)
    8. org.springframework.roo.file.monitor.polling.PollingFileMonitorService.publish(PollingFileMonitorService.java:433)
    9. org.springframework.roo.file.monitor.polling.PollingFileMonitorService.publishRequestedFileEvents(PollingFileMonitorService.java:456)
    10. org.springframework.roo.file.monitor.polling.PollingFileMonitorService.scanNotified(PollingFileMonitorService.java:660)
    11. org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:335)
    12. org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:71)
    13. org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:44)
    14. org.springframework.roo.shell.AbstractShell.executeCommandImpl(AbstractShell.java:242)
    15. org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:149)
    16. org.springframework.roo.shell.AbstractShell.executeScriptLine(AbstractShell.java:298)
    17. org.springframework.roo.shell.AbstractShell.script(AbstractShell.java:521)
    17 frames
  5. 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
  6. org.springframework.roo
    JLineShell.run
    1. org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(ProcessManagerHostedExecutionStrategy.java:47)
    2. org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:325)
    3. org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:71)
    4. org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:44)
    5. org.springframework.roo.shell.AbstractShell.executeCommandImpl(AbstractShell.java:242)
    6. org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:149)
    7. org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:421)
    8. org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:539)
    8 frames