-
Type: Bug
-
Resolution: Cannot Reproduce
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:WinXP, Java SE 6u13, Mongo Java driver mongo-0.7.jar
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())
}
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)