java.lang.ArrayIndexOutOfBoundsException: 1

Hibernate JIRA | Bryan Brouckaert | 1 decade ago
  1. 0

    @javax.persistence.MapKey does not seem to work with @embedded fields. The following is programmed (simplified): @Entity public class MyClass { @Id @GeneratedValue private int id; @MapKey(name="myKey") private Map<KeyClass, OtherClass> myField; ... } @Entity public class OtherClass { @Id @GeneratedValue private int id; @Embedded private KeyClass myKey; ... } @Embeddable public class KeyClass { private String key1; private String key2; } The following exception is thrown: ERROR 11-10 08:52:30,862 (AbstractController.java:incrementState:440) -Error installing to Start: name=persistence.units:jar=sidecam.jar,unitName=sidecam state=Create java.lang.ArrayIndexOutOfBoundsException: 1 at org.hibernate.sql.SimpleSelect.addColumns(SimpleSelect.java:41) at org.hibernate.persister.collection.AbstractCollectionPersister.generateSelectRowByIndexString(AbstractCollectionPersister.java:894) at org.hibernate.persister.collection.AbstractCollectionPersister.<init>(AbstractCollectionPersister.java:478) at org.hibernate.persister.collection.OneToManyPersister.<init>(OneToManyPersister.java:60) at org.hibernate.persister.PersisterFactory.createCollectionPersister(PersisterFactory.java:72) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:250) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:691) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127) at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:55) at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:107) at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66) at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:75) at org.jboss.kernel.plugins.dependency.LifecycleAction.installAction(LifecycleAction.java:115) at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.install(KernelControllerContextAction.java:100) at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:226) at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:709) at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:429) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:538) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:472) at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:274) at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:177) at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:79) at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:73) at org.jboss.ejb3.MCKernelAbstraction.install(MCKernelAbstraction.java:131) at org.jboss.ejb3.Ejb3Deployment.startPersistenceUnits(Ejb3Deployment.java:467) at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:317) at org.jboss.ejb3.embedded.EJB3StandaloneDeployer.start(EJB3StandaloneDeployer.java:478) at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.scanClasspath(EJB3StandaloneBootstrap.java:235) at be.sigedis.argo.sidecam.tests.ServiceCarriereTest.startupEmbeddedJboss(ServiceCarriereTest.java:55) at be.sigedis.argo.sidecam.tests.ServiceCarriereTest$1.setUp(ServiceCarriereTest.java:41) at junit.extensions.TestSetup$1.protect(TestSetup.java:18) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.extensions.TestSetup.run(TestSetup.java:23) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:297) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:567)

    Hibernate JIRA | 1 decade ago | Bryan Brouckaert
    java.lang.ArrayIndexOutOfBoundsException: 1
  2. 0

    @javax.persistence.MapKey does not seem to work with @embedded fields. The following is programmed (simplified): @Entity public class MyClass { @Id @GeneratedValue private int id; @MapKey(name="myKey") private Map<KeyClass, OtherClass> myField; ... } @Entity public class OtherClass { @Id @GeneratedValue private int id; @Embedded private KeyClass myKey; ... } @Embeddable public class KeyClass { private String key1; private String key2; } The following exception is thrown: ERROR 11-10 08:52:30,862 (AbstractController.java:incrementState:440) -Error installing to Start: name=persistence.units:jar=sidecam.jar,unitName=sidecam state=Create java.lang.ArrayIndexOutOfBoundsException: 1 at org.hibernate.sql.SimpleSelect.addColumns(SimpleSelect.java:41) at org.hibernate.persister.collection.AbstractCollectionPersister.generateSelectRowByIndexString(AbstractCollectionPersister.java:894) at org.hibernate.persister.collection.AbstractCollectionPersister.<init>(AbstractCollectionPersister.java:478) at org.hibernate.persister.collection.OneToManyPersister.<init>(OneToManyPersister.java:60) at org.hibernate.persister.PersisterFactory.createCollectionPersister(PersisterFactory.java:72) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:250) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:691) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127) at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:55) at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:107) at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66) at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:75) at org.jboss.kernel.plugins.dependency.LifecycleAction.installAction(LifecycleAction.java:115) at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.install(KernelControllerContextAction.java:100) at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:226) at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:709) at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:429) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:538) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:472) at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:274) at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:177) at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:79) at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:73) at org.jboss.ejb3.MCKernelAbstraction.install(MCKernelAbstraction.java:131) at org.jboss.ejb3.Ejb3Deployment.startPersistenceUnits(Ejb3Deployment.java:467) at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:317) at org.jboss.ejb3.embedded.EJB3StandaloneDeployer.start(EJB3StandaloneDeployer.java:478) at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.scanClasspath(EJB3StandaloneBootstrap.java:235) at be.sigedis.argo.sidecam.tests.ServiceCarriereTest.startupEmbeddedJboss(ServiceCarriereTest.java:55) at be.sigedis.argo.sidecam.tests.ServiceCarriereTest$1.setUp(ServiceCarriereTest.java:41) at junit.extensions.TestSetup$1.protect(TestSetup.java:18) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.extensions.TestSetup.run(TestSetup.java:23) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:297) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:567)

    Hibernate JIRA | 1 decade ago | Bryan Brouckaert
    java.lang.ArrayIndexOutOfBoundsException: 1
  3. 0

    ArrayIndexOutOfBounds When Splitting String

    Stack Overflow | 4 years ago | n0shadow
    java.lang.ArrayIndexOutOfBoundsException: 1
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    ArrayIndexOutOfBoundsException occurring when program running

    Stack Overflow | 4 years ago | dharma
    java.lang.ArrayIndexOutOfBoundsException: 1
  6. 0

    Parsing Data from CSV to Array in Java

    Stack Overflow | 5 years ago
    java.lang.ArrayIndexOutOfBoundsException: 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.ArrayIndexOutOfBoundsException

      1

      at org.hibernate.sql.SimpleSelect.addColumns()
    2. Hibernate
      OneToManyPersister.<init>
      1. org.hibernate.sql.SimpleSelect.addColumns(SimpleSelect.java:41)
      2. org.hibernate.persister.collection.AbstractCollectionPersister.generateSelectRowByIndexString(AbstractCollectionPersister.java:894)
      3. org.hibernate.persister.collection.AbstractCollectionPersister.<init>(AbstractCollectionPersister.java:478)
      4. org.hibernate.persister.collection.OneToManyPersister.<init>(OneToManyPersister.java:60)
      4 frames
    3. Hibernate
      SessionFactoryImpl.<init>
      1. org.hibernate.persister.PersisterFactory.createCollectionPersister(PersisterFactory.java:72)
      2. org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:250)
      2 frames
    4. Hibernate
      Configuration.buildSessionFactory
      1. org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218)
      1 frame
    5. Hibernate EJB
      HibernatePersistence.createContainerEntityManagerFactory
      1. org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:691)
      2. org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
      2 frames
    6. org.jboss.ejb3
      PersistenceUnitDeployment.start
      1. org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264)
      1 frame
    7. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      4. java.lang.reflect.Method.invoke(Unknown Source)
      4 frames
    8. JBoss Reflection
      BasicMethodJoinPoint.dispatch
      1. org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:55)
      2. org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:107)
      3. org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
      3 frames
    9. JBoss Microcontainer Kernel
      KernelControllerContextAction.install
      1. org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:75)
      2. org.jboss.kernel.plugins.dependency.LifecycleAction.installAction(LifecycleAction.java:115)
      3. org.jboss.kernel.plugins.dependency.KernelControllerContextAction.install(KernelControllerContextAction.java:100)
      3 frames
    10. JBoss Microcontainer Dependency
      AbstractController.install
      1. org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
      2. org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:226)
      3. org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:709)
      4. org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:429)
      5. org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:538)
      6. org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:472)
      7. org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:274)
      8. org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:177)
      8 frames
    11. JBoss Microcontainer Kernel
      AbstractKernelController.install
      1. org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:79)
      2. org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:73)
      2 frames
    12. org.jboss.ejb3
      EJB3StandaloneBootstrap.scanClasspath
      1. org.jboss.ejb3.MCKernelAbstraction.install(MCKernelAbstraction.java:131)
      2. org.jboss.ejb3.Ejb3Deployment.startPersistenceUnits(Ejb3Deployment.java:467)
      3. org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:317)
      4. org.jboss.ejb3.embedded.EJB3StandaloneDeployer.start(EJB3StandaloneDeployer.java:478)
      5. org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.scanClasspath(EJB3StandaloneBootstrap.java:235)
      5 frames
    13. be.sigedis.argo
      ServiceCarriereTest$1.setUp
      1. be.sigedis.argo.sidecam.tests.ServiceCarriereTest.startupEmbeddedJboss(ServiceCarriereTest.java:55)
      2. be.sigedis.argo.sidecam.tests.ServiceCarriereTest$1.setUp(ServiceCarriereTest.java:41)
      2 frames
    14. JUnit
      TestSetup.run
      1. junit.extensions.TestSetup$1.protect(TestSetup.java:18)
      2. junit.framework.TestResult.runProtected(TestResult.java:124)
      3. junit.extensions.TestSetup.run(TestSetup.java:23)
      3 frames
    15. Apache Ant + JUnit
      JUnitTestRunner.main
      1. org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:297)
      2. org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672)
      3. org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:567)
      3 frames