Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » java.lang.ArrayIndexOutOfBoundsException: -1(java.lang.ArrayIndexOutOfBoundsException: -1 in org.eclipse.persistence.mappings.ForeignReferenceMapping.extractResultFromBatchQuery)
java.lang.ArrayIndexOutOfBoundsException: -1 [message #998018] Wed, 09 January 2013 07:49 Go to next message
Guido Häp is currently offline Guido HäpFriend
Messages: 5
Registered: January 2013
Location: Gerolstein
Junior Member
Hallo everybody.

I get an exception that seems to occur randomly in a batch-dataimport.
The import handles a few hundred datasets correctly before the exception occurs.

Does anybody know this problem?


Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.elementData(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at org.eclipse.persistence.mappings.ForeignReferenceMapping.extractResultFromBatchQuery(ForeignReferenceMapping.java:523)
at org.eclipse.persistence.mappings.CollectionMapping.extractResultFromBatchQuery(CollectionMapping.java:898)
at org.eclipse.persistence.internal.indirection.BatchValueHolder.instantiate(BatchValueHolder.java:58)
at org.eclipse.persistence.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:99)
at org.eclipse.persistence.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:88)
at org.eclipse.persistence.internal.indirection.UnitOfWorkValueHolder.instantiateImpl(UnitOfWorkValueHolder.java:161)
at org.eclipse.persistence.internal.indirection.UnitOfWorkValueHolder.instantiate(UnitOfWorkValueHolder.java:222)
at org.eclipse.persistence.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:88)
at org.eclipse.persistence.indirection.IndirectSet.buildDelegate(IndirectSet.java:200)
at org.eclipse.persistence.indirection.IndirectSet.getDelegate(IndirectSet.java:364)
at org.eclipse.persistence.indirection.IndirectSet$1.<init>(IndirectSet.java:431)
at org.eclipse.persistence.indirection.IndirectSet.iterator(IndirectSet.java:430)
Re: java.lang.ArrayIndexOutOfBoundsException: -1 [message #998705 is a reply to message #998018] Thu, 10 January 2013 14:37 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Odd. Check that you have the latest version/patch it may have been something fixed.

Otherwise try to create a test to reproduce the issue and log a bug.


James : Wiki : Book : Blog : Twitter
Re: java.lang.ArrayIndexOutOfBoundsException: -1 [message #1063029 is a reply to message #998705] Tue, 11 June 2013 20:21 Go to previous messageGo to next message
Michael Nielson is currently offline Michael NielsonFriend
Messages: 15
Registered: April 2011
Junior Member
I am also seeing this same problem intermittently. I think this may be a concurrency issue. I also see this error in the same place:

java.util.ConcurrentModificationException
at java.util.ArrayList$SubList.checkForComodification(ArrayList.java:1129)
at java.util.ArrayList$SubList.size(ArrayList.java:958)
at java.util.AbstractCollection.toArray(AbstractCollection.java:136)
at java.util.ArrayList.<init>(ArrayList.java:151)
at org.eclipse.persistence.mappings.ForeignReferenceMapping.extractResultFromBatchQuery(ForeignReferenceMapping.java:555)
at org.eclipse.persistence.mappings.CollectionMapping.extractResultFromBatchQuery(CollectionMapping.java:864)
at org.eclipse.persistence.internal.indirection.BatchValueHolder.instantiate(BatchValueHolder.java:58)
at org.eclipse.persistence.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:88)
at org.eclipse.persistence.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:88)
Re: java.lang.ArrayIndexOutOfBoundsException: -1 [message #1064272 is a reply to message #1063029] Tue, 18 June 2013 14:12 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Seems to be a different issue. Please log a bug for it, and include as much detail as possible. If you can create an isolated test, that would be best.

What was the query you executed, and what are the other threads doing to get this error?
What type of batch fetching are you using, IN? Are you also using join fetching in the same query?
What version are you using, did you try 2.5? (can you include the stack trace from 2.5)


James : Wiki : Book : Blog : Twitter
Re: java.lang.ArrayIndexOutOfBoundsException: -1 [message #1064357 is a reply to message #1064272] Tue, 18 June 2013 20:53 Go to previous messageGo to next message
Michael Nielson is currently offline Michael NielsonFriend
Messages: 15
Registered: April 2011
Junior Member
I'm running 2.3.2, I haven't been able to reproduce this locally yet, only in production under high load.

I'll see what else I can find and log a bug.

Michael

Re: java.lang.ArrayIndexOutOfBoundsException: -1 [message #1065858 is a reply to message #1064272] Thu, 27 June 2013 22:13 Go to previous message
Michael Nielson is currently offline Michael NielsonFriend
Messages: 15
Registered: April 2011
Junior Member
I was able to reproduce this locally, here is the bug I logged:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=411838
Previous Topic:ConversionException When Using Enum in Composite Primary Keys
Next Topic:Multiple JPA Persistences loading issue in JBOSS 5
Goto Forum:
  


Current Time: Mon Dec 22 15:49:24 GMT 2014

Powered by FUDForum. Page generated in 0.01807 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software