today, I tried the latest version of mongo-java-driver. Unfortunately, I
got some errors querying a collection:
java.lang.UnsupportedOperationException: BSONDecoder doesn't understand type : 100 name:
at org.bson.BSONDecoder.decodeElement(BSONDecoder.java:210)
at org.bson.BSONDecoder._decode(BSONDecoder.java:63)
at org.bson.BSONDecoder.decode(BSONDecoder.java:42)
at com.mongodb.Response.<init>(Response.java:63)
at com.mongodb.DBPort.go(DBPort.java:101)
at com.mongodb.DBPort.go(DBPort.java:66)
at com.mongodb.DBPort.call(DBPort.java:56)
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:211)
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:284)
at com.mongodb.DBCursor._check(DBCursor.java:309)
at com.mongodb.DBCursor._hasNext(DBCursor.java:431)
at com.mongodb.DBCursor.hasNext(DBCursor.java:456)
This error does not occur with version 2.3.
My query is as follows (groovy):
[...]
db.slaveOk()
def coll = db.getCollection('badlist')
int count = 0
def query = new BasicDBObject()
def sort = new BasicDBObject('_id', 1)
DBCursor cur = coll.find(query).sort(sort).batchSize(10).limit(10)
while (cur.hasNext()) {
count++
def o = cur.next()
println o.getString('_id')
}
[...]
My mongodb server is a replica set. The primary runs 1.6.3, the
secondary 1.7.3. Same error with both versions. I have used
mongodump/mongorestore to put the collection into another mongo server
on my local machine, but the error does not occur on the local
machine.
Another strange thing is, that sometimes, the query succeeds. I have now
run the query 8 times, and success/failure was 0 0 0 1 0 1 1 0
I have created a pcap-file of the network packets, which I could provide
for diagnosis. Is there anything else I could do to support diagnosis of
this problem?
Greetings, Swen
Another data point: if I lower the batchSize to 2, the query always
works. If I increase the limit to 100 (with batchSize > 2), the query
always fails.
--Swen
> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>
>
Great, this does work. But there seems to remain another issue (with
2.3, too): I'm using requestStart() and requestDone(), and with the
latest driver versions, this leads to a NullPointerException:
java.lang.NullPointerException
at com.mongodb.DBTCPConnector$MyPort.requestDone(DBTCPConnector.java:334)
at com.mongodb.DBTCPConnector.requestDone(DBTCPConnector.java:106)
at com.mongodb.DBApiLayer.requestDone(DBApiLayer.java:75)
I had to remove all calls to requestStart() and requestDone().
Unfortunately, I have no simple test case.
--Swen