I have a MongoDB instance that I have stared for unit testing. At the
end before exiting my client calls the following to shutdown my test
instance of MongoDB.
//this is line 82 from the stack trace below
mongo.getDB("admin").command(new BasicDBObject("shutdown",1));
Because this is running on 127.0.0.1 the shutdown works just as
expected however after this point the Java Driver 2.6.2 spits out the
following stack trace.
Jun 7, 2011 8:17:34 AM com.mongodb.DBPortPool gotError
WARNING: emptying DBPortPool to
127.0.0.1:27001 b/c of error
java.io.EOFException
at org.bson.io.Bits.readFully(Bits.java:37)
at org.bson.io.Bits.readFully(Bits.java:28)
at com.mongodb.Response.<init>(Response.java:35)
at com.mongodb.DBPort.go(DBPort.java:110)
at com.mongodb.DBPort.go(DBPort.java:75)
at com.mongodb.DBPort.call(DBPort.java:65)
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:207)
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:296)
at com.mongodb.DB.command(DB.java:152)
at com.mongodb.DB.command(DB.java:137)
at com.ociweb.mongoDB.test.TestApp.main(TestApp.java:82)
I can prevent the driver from printing the stack trace with this
command however this is a unit test I would like to avoid suppressing
all the stacks just to mask this one problem.
Logger.getLogger("com.mongodb").setLevel(Level.OFF);
Is this a bug in the driver? Is there a better way to do this?