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

795 views
Skip to first unread message

Ranjit Chavan

unread,
Apr 30, 2019, 12:50:59 PM4/30/19
to DSpace Community
Hi
my dspce version is 6.0 but i am uploading batch import by following command 
i am getting error  
root@ubcourt:/dspace# bin/dspace import --add --eperson=dspace@localhost --collection=fc51b762-8a25-407e-bd9e-a1db4f3aca71 --source=/home/ubuntu/Desktop/orders/bulksample.zip --mapfile=/home/Desktop/mapdir/mapfile

my Error is like this please give me some solution.

Destination collections:
Started: 1556631079769
Ended: 1556631081964
Elapsed time: 2 secs (2195 msecs)
Exception: Index: 0, Size: 0
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:657)
at java.util.ArrayList.set(ArrayList.java:448)
at org.dspace.app.itemimport.ItemImportCLITool.main(ItemImportCLITool.java:344)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229)
at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81)

Paul Warner

unread,
Mar 10, 2020, 10:44:25 AM3/10/20
to DSpace Community
Hi,

I ran into this problem, and looked it up, and found no answer here.  So even though it has been a while, I will post what I have found works.  I did this by checking the source code for 

org.dspace.app.itemimport.ItemImportCLITool.main(ItemImportCLITool.java:344)

Note this is in the stack trace.  So in the code, it checks if the id is a handle, and if not, it tries to convert the UUID into something it can recognize.  So I was trying to hand it an id like Ranjit below.  I just switched to the handle, in my case 123456789/21368

Then it worked!  So try the handle!  :-)

Best regards,
Paul
Reply all
Reply to author
Forward
0 new messages