java.lang.ArrayIndexOutOfBoundsException: 1

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • @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)
    via by Bryan Brouckaert,
  • @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)
    via by Bryan Brouckaert,
    • 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)
    No Bugmate found.