org.apache.openjpa.persistence.PersistenceException

The index 0 is out of range. FailedObject: select c.xyz, ev.abc, ev.def, ctc.ghi from Test c inner join EKView ev on c.ekid = ev.ekid inner join CTypeCode ctc on c.CType = ctc.CType where c.PID = ? and csc.ShortName = 'FOUND' and c.OrgID = 100 and CONVERT(DATE, ?) <= CONVERT(date,c.EndDate) order by c.EffDate desc [java.lang.String]

Samebug tips1

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web594

  • via Stack Overflow by Simal
    ,
  • via Unknown by Unknown author,
  • Stack trace

    • org.apache.openjpa.persistence.PersistenceException: The index 0 is out of range. FailedObject: select c.xyz, ev.abc, ev.def, ctc.ghi from Test c inner join EKView ev on c.ekid = ev.ekid inner join CTypeCode ctc on c.CType = ctc.CType where c.PID = ? and csc.ShortName = 'FOUND' and c.OrgID = 100 and CONVERT(DATE, ?) <= CONVERT(date,c.EndDate) order by c.EffDate desc [java.lang.String] at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4959) at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4919) at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:136) at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:110) at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:62) at org.apache.openjpa.jdbc.kernel.MappedQueryResultObjectProvider.handleCheckedException(MappedQueryResultObjectProvider.java:139) at org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:40) at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1251) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1007) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:863) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:794) at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:542) at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:315) at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:331) at org.abpeds.moc.persistence.test.PersonNamedNativeQueryTest.testCurrentRawCertSame(PersonNamedNativeQueryTest.java:447) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The index 0 is out of range. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:190) at com.microsoft.sqlserver.jdbc.SQLServerResultSet.verifyValidColumnIndex(SQLServerResultSet.java:531) at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getterGetColumn(SQLServerResultSet.java:2049) at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getValue(SQLServerResultSet.java:2082) at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getValue(SQLServerResultSet.java:2067) at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getInt(SQLServerResultSet.java:2310) at org.apache.openjpa.lib.jdbc.DelegatingResultSet.getInt(DelegatingResultSet.java:159) at org.apache.openjpa.jdbc.sql.DBDictionary.getInt(DBDictionary.java:837) at org.apache.openjpa.jdbc.sql.ResultSetResult.getIntInternal(ResultSetResult.java:336) at org.apache.openjpa.jdbc.sql.ResultSetResult.getObjectInternal(ResultSetResult.java:389) at org.apache.openjpa.jdbc.sql.AbstractResult.getObject(AbstractResult.java:696) at org.apache.openjpa.jdbc.kernel.MappedQueryResultObjectProvider$MappingResult.getObjectInternal(MappedQueryResultObjectProvider.java:419) at org.apache.openjpa.jdbc.sql.AbstractResult.getObject(AbstractResult.java:696) at org.apache.openjpa.jdbc.meta.strats.PrimitiveFieldStrategy.getPrimaryKeyValue(PrimitiveFieldStrategy.java:305) at org.apache.openjpa.jdbc.meta.ClassMapping.getObjectId(ClassMapping.java:188) at org.apache.openjpa.jdbc.meta.ClassMapping.getObjectId(ClassMapping.java:147) at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1031) at com.ibm.ws.persistence.jdbc.kernel.WsJpaJDBCStoreManager.load(WsJpaJDBCStoreManager.java:112) at org.apache.openjpa.jdbc.kernel.MappedQueryResultObjectProvider$MappingResult.load(MappedQueryResultObjectProvider.java:191) at org.apache.openjpa.jdbc.kernel.MappedQueryResultObjectProvider$MappingResult.load(MappedQueryResultObjectProvider.java:180) at org.apache.openjpa.jdbc.kernel.MappedQueryResultObjectProvider$MappingResult.load(MappedQueryResultObjectProvider.java:171) at org.apache.openjpa.jdbc.kernel.MappedQueryResultObjectProvider.getResultObject(MappedQueryResultObjectProvider.java:99) at org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:36) ... 35 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Andreas HäberAndreas Häber
    39 times, last one
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    oddodd
    4 times, last one
    SteVio1989SteVio1989
    2 times, last one
    94 more bugmates