java.lang.IndexOutOfBoundsException

JIRA | Jason Sachs | 7 years ago
  1. 0

    I have some large documents (representing the contents of files in the 250K-1MB range) that cannot be read with the Java driver. The failure happens with DBCursor.hasNext(): public void catalog() { DBObject mdref = new BasicDBObject(); mdref.put("metadata", 1); DBCursor cursor = this.coll.find(); // the above line causes an error (the following line works ok) // DBCursor cursor = this.coll.find(new BasicDBObject(), mdref); System.out.println("Found "+cursor.count()+" objects."); while (cursor.hasNext()) { DBObject obj = cursor.next(); System.out.println(obj); } } When I run this on my database collection, I get the following. The call to find() succeeds, and the cursor's count() method works ok, but it bombs on the first hasNext() call, looks like some kind of buffer overrun. Found 10 objects. Exception in thread "main" java.lang.IndexOutOfBoundsException at java.nio.Buffer.checkBounds(Unknown Source) at java.nio.DirectByteBuffer.get(Unknown Source) at com.mongodb.ByteDecoder.decodeNext(ByteDecoder.java:189) at com.mongodb.ByteDecoder.readObject(ByteDecoder.java:103) at com.mongodb.DBApiLayer$SingleResult.<init>(DBApiLayer.java:538) at com.mongodb.DBApiLayer$MyCollection.find(DBApiLayer.java:419) at com.mongodb.DBCursor._check(DBCursor.java:214) at com.mongodb.DBCursor._hasNext(DBCursor.java:322) at com.mongodb.DBCursor.hasNext(DBCursor.java:347) at com.dekaresearch.tools.datasheets.Manager.catalog(Manager.java:45) at com.dekaresearch.tools.datasheets.Manager$Action$2.execute(Manager.java:21) at com.dekaresearch.tools.datasheets.Manager.main(Manager.java:69)

    JIRA | 7 years ago | Jason Sachs
    java.lang.IndexOutOfBoundsException
  2. 0

    jetpack causes client crash

    GitHub | 3 years ago | KiwiJase
    java.lang.IndexOutOfBoundsException
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    crash

    GitHub | 2 years ago | lieven121
    java.lang.IndexOutOfBoundsException

    2 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

      No message provided

      at java.nio.Buffer.checkBounds()
    2. Java RT
      DirectByteBuffer.get
      1. java.nio.Buffer.checkBounds(Unknown Source)
      2. java.nio.DirectByteBuffer.get(Unknown Source)
      2 frames
    3. MongoDB Java Driver
      DBCursor.hasNext
      1. com.mongodb.ByteDecoder.decodeNext(ByteDecoder.java:189)
      2. com.mongodb.ByteDecoder.readObject(ByteDecoder.java:103)
      3. com.mongodb.DBApiLayer$SingleResult.<init>(DBApiLayer.java:538)
      4. com.mongodb.DBApiLayer$MyCollection.find(DBApiLayer.java:419)
      5. com.mongodb.DBCursor._check(DBCursor.java:214)
      6. com.mongodb.DBCursor._hasNext(DBCursor.java:322)
      7. com.mongodb.DBCursor.hasNext(DBCursor.java:347)
      7 frames
    4. com.dekaresearch.tools
      Manager.main
      1. com.dekaresearch.tools.datasheets.Manager.catalog(Manager.java:45)
      2. com.dekaresearch.tools.datasheets.Manager$Action$2.execute(Manager.java:21)
      3. com.dekaresearch.tools.datasheets.Manager.main(Manager.java:69)
      3 frames