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

Google Groups | Unknown author | 2 years ago
  1. 0

    DrawingTool problem

    Google Groups | 2 years ago | Unknown author
    java.lang.IndexOutOfBoundsException: Index: 3, Size: 0
  2. 0

    [PDFBOX-1586] IndexOutOfBoundsException when saving a document (at random) - ASF JIRA

    apache.org | 1 year ago
    java.lang.IndexOutOfBoundsException: Index: 3, Size: 0
  3. 0

    Getting the following stacktrace: org.apache.pdfbox.exceptions.COSVisitorException: java.lang.IndexOutOfBoundsException: Index: 28, Size: 0 at org.apache.pdfbox.pdfwriter.COSWriter.visitFromStream(COSWriter.java:1245) at org.apache.pdfbox.cos.COSStream.accept(COSStream.java:201) at org.apache.pdfbox.cos.COSObject.accept(COSObject.java:206) at org.apache.pdfbox.pdfwriter.COSWriter.doWriteObject(COSWriter.java:524) at org.apache.pdfbox.pdfwriter.COSWriter.doWriteBody(COSWriter.java:434) at org.apache.pdfbox.pdfwriter.COSWriter.visitFromDocument(COSWriter.java:1056) at org.apache.pdfbox.cos.COSDocument.accept(COSDocument.java:496) at org.apache.pdfbox.pdfwriter.COSWriter.write(COSWriter.java:1392) at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:1157) at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:1138) ... Caused by: java.lang.IndexOutOfBoundsException: Index: 28, Size: 0 at java.util.ArrayList.rangeCheck(ArrayList.java:604) at java.util.ArrayList.get(ArrayList.java:382) at org.apache.pdfbox.io.RandomAccessBuffer.seek(RandomAccessBuffer.java:84) at org.apache.pdfbox.io.RandomAccessFileInputStream.read(RandomAccessFileInputStream.java:96) at java.io.BufferedInputStream.fill(BufferedInputStream.java:235) at java.io.BufferedInputStream.read1(BufferedInputStream.java:275) at java.io.BufferedInputStream.read(BufferedInputStream.java:334) at org.apache.pdfbox.pdfwriter.COSWriter.visitFromStream(COSWriter.java:1232) I'll add some context. We have a "data pipeline" in which a Windows Print Monitor sends postscript into a servlet which then uses GhostScript 9.05 to convert in-memory to PDF. This PDF is then loaded into PDFBox using PDDocument.load(). At this point we split the original PDF into multiple smaller ones each of which is saved to a ByteArrayOutputStream. At the point of save() we are having serious reliability issues. Taking an original PDF from Ghostscript we have saved this into a unit test to replicate the problem without success. If we attempt to re-execute the pipeline to take the original PDF and split it, we get apparently random percentages of saved documents. For instance, on a 990 page document (text, no images), to be split into 990 1-page documents using Tomcat 7 with -Xmx=512m: Pass 1: 50% were saved, 50% ended with stack traces Pass 2: 100% were saved Pass 3: 100% were saved The same test with -Xmx=128m ended several times with just 1 document saved, the rest were stack traces. We have also seen this randomly hit a sample document consisting of four pages to be split into two two-page documents so it does not appear to be memory related. We also added code to catch the IndexOutOfBoundsException and make up to ten attempts to repeat, but it seems the save() either works the first time or not at all. We're thinking there are environmental factors here but we're now focused on getting this nailed. Any advice or assistance will be welcomed.

    Apache's JIRA Issue Tracker | 4 years ago | James Green
    java.lang.IndexOutOfBoundsException: Index: 3, Size: 0
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Getting the following stacktrace: org.apache.pdfbox.exceptions.COSVisitorException: java.lang.IndexOutOfBoundsException: Index: 28, Size: 0 at org.apache.pdfbox.pdfwriter.COSWriter.visitFromStream(COSWriter.java:1245) at org.apache.pdfbox.cos.COSStream.accept(COSStream.java:201) at org.apache.pdfbox.cos.COSObject.accept(COSObject.java:206) at org.apache.pdfbox.pdfwriter.COSWriter.doWriteObject(COSWriter.java:524) at org.apache.pdfbox.pdfwriter.COSWriter.doWriteBody(COSWriter.java:434) at org.apache.pdfbox.pdfwriter.COSWriter.visitFromDocument(COSWriter.java:1056) at org.apache.pdfbox.cos.COSDocument.accept(COSDocument.java:496) at org.apache.pdfbox.pdfwriter.COSWriter.write(COSWriter.java:1392) at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:1157) at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:1138) ... Caused by: java.lang.IndexOutOfBoundsException: Index: 28, Size: 0 at java.util.ArrayList.rangeCheck(ArrayList.java:604) at java.util.ArrayList.get(ArrayList.java:382) at org.apache.pdfbox.io.RandomAccessBuffer.seek(RandomAccessBuffer.java:84) at org.apache.pdfbox.io.RandomAccessFileInputStream.read(RandomAccessFileInputStream.java:96) at java.io.BufferedInputStream.fill(BufferedInputStream.java:235) at java.io.BufferedInputStream.read1(BufferedInputStream.java:275) at java.io.BufferedInputStream.read(BufferedInputStream.java:334) at org.apache.pdfbox.pdfwriter.COSWriter.visitFromStream(COSWriter.java:1232) I'll add some context. We have a "data pipeline" in which a Windows Print Monitor sends postscript into a servlet which then uses GhostScript 9.05 to convert in-memory to PDF. This PDF is then loaded into PDFBox using PDDocument.load(). At this point we split the original PDF into multiple smaller ones each of which is saved to a ByteArrayOutputStream. At the point of save() we are having serious reliability issues. Taking an original PDF from Ghostscript we have saved this into a unit test to replicate the problem without success. If we attempt to re-execute the pipeline to take the original PDF and split it, we get apparently random percentages of saved documents. For instance, on a 990 page document (text, no images), to be split into 990 1-page documents using Tomcat 7 with -Xmx=512m: Pass 1: 50% were saved, 50% ended with stack traces Pass 2: 100% were saved Pass 3: 100% were saved The same test with -Xmx=128m ended several times with just 1 document saved, the rest were stack traces. We have also seen this randomly hit a sample document consisting of four pages to be split into two two-page documents so it does not appear to be memory related. We also added code to catch the IndexOutOfBoundsException and make up to ten attempts to repeat, but it seems the save() either works the first time or not at all. We're thinking there are environmental factors here but we're now focused on getting this nailed. Any advice or assistance will be welcomed.

    Apache's JIRA Issue Tracker | 4 years ago | James Green
    java.lang.IndexOutOfBoundsException: Index: 3, Size: 0
  6. 0

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

    GitHub | 1 year ago | beemi
    java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

  1. bmacedo 4 times, last 5 days ago
  2. mhicauber 1 times, last 5 days ago
  3. filpgame 2 times, last 1 week ago
  4. tvrmsmith 1 times, last 1 week ago
  5. Indri Yunita 12 times, last 1 week ago
67 more registered users
28 unregistered visitors
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.IndexOutOfBoundsException

    Index: 3, Size: 0

    at java.util.ArrayList.rangeCheck()
  2. Java RT
    ArrayList.get
    1. java.util.ArrayList.rangeCheck(ArrayList.java:653)
    2. java.util.ArrayList.get(ArrayList.java:429)
    2 frames
  3. com.bbn.openmap
    OMDrawingToolMouseMode.mouseReleased
    1. com.bbn.openmap.omGraphics.EditableOMPoly.addMovingPoint(EditableOMPoly.java:652)
    2. com.bbn.openmap.omGraphics.editable.PolyAddPointState.mouseReleased(PolyAddPointState.java:69)
    3. com.bbn.openmap.omGraphics.EditableOMGraphic.mouseReleased(EditableOMGraphic.java:642)
    4. com.bbn.openmap.tools.drawing.OMDrawingToolMouseMode.mouseReleased(OMDrawingToolMouseMode.java:112)
    4 frames
  4. Java RT
    EventDispatchThread.run
    1. java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290)
    2. java.awt.Component.processMouseEvent(Component.java:6525)
    3. javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
    4. java.awt.Component.processEvent(Component.java:6290)
    5. java.awt.Container.processEvent(Container.java:2234)
    6. java.awt.Component.dispatchEventImpl(Component.java:4881)
    7. java.awt.Container.dispatchEventImpl(Container.java:2292)
    8. java.awt.Component.dispatchEvent(Component.java:4703)
    9. java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4898)
    10. java.awt.LightweightDispatcher.processMouseEvent(Container.java:4533)
    11. java.awt.LightweightDispatcher.dispatchEvent(Container.java:4462)
    12. java.awt.Container.dispatchEventImpl(Container.java:2278)
    13. java.awt.Window.dispatchEventImpl(Window.java:2739)
    14. java.awt.Component.dispatchEvent(Component.java:4703)
    15. java.awt.EventQueue.dispatchEventImpl(EventQueue.java:746)
    16. java.awt.EventQueue.access$400(EventQueue.java:97)
    17. java.awt.EventQueue$3.run(EventQueue.java:697)
    18. java.awt.EventQueue$3.run(EventQueue.java:691)
    19. java.security.AccessController.doPrivileged(Native Method)
    20. java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
    21. java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
    22. java.awt.EventQueue$4.run(EventQueue.java:719)
    23. java.awt.EventQueue$4.run(EventQueue.java:717)
    24. java.security.AccessController.doPrivileged(Native Method)
    25. java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
    26. java.awt.EventQueue.dispatchEvent(EventQueue.java:716)
    27. java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    28. java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    29. java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    30. java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    31. java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    32. java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    32 frames