JIRA | Jason Sachs | 8 years ago
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  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 =; 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( at com.mongodb.ByteDecoder.readObject( at com.mongodb.DBApiLayer$SingleResult.<init>( at com.mongodb.DBApiLayer$MyCollection.find( at com.mongodb.DBCursor._check( at com.mongodb.DBCursor._hasNext( at com.mongodb.DBCursor.hasNext( at at$Action$2.execute( at

    JIRA | 8 years ago | Jason Sachs
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0


    GitHub | 2 years ago | lieven121

    4 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
      1. java.nio.Buffer.checkBounds(Unknown Source)
      2. java.nio.DirectByteBuffer.get(Unknown Source)
      2 frames
    3. MongoDB Java Driver
      1. com.mongodb.ByteDecoder.decodeNext(
      2. com.mongodb.ByteDecoder.readObject(
      3. com.mongodb.DBApiLayer$SingleResult.<init>(
      4. com.mongodb.DBApiLayer$MyCollection.find(
      5. com.mongodb.DBCursor._check(
      6. com.mongodb.DBCursor._hasNext(
      7. com.mongodb.DBCursor.hasNext(
      7 frames
      3 frames