Hello,
I am calling org.springframework.data.mongodb.core.MongoTemplat e.getCollection(String collectionName) from multiple threads and I get this exception quite often:
Also in mongod log I observe the following message every time I get this exception:Code:org.springframework.data.mongodb.CannotGetMongoDbConnectionException: Failed to authenticate to database [****], username = [****], password = [****] at org.springframework.data.mongodb.core.MongoDbUtils.doGetDB(MongoDbUtils.java:100) at org.springframework.data.mongodb.core.MongoDbUtils.getDB(MongoDbUtils.java:69) at org.springframework.data.mongodb.core.SimpleMongoDbFactory.getDb(SimpleMongoDbFactory.java:98) at org.springframework.data.mongodb.core.SimpleMongoDbFactory.getDb(SimpleMongoDbFactory.java:87) at org.springframework.data.mongodb.core.MongoTemplate.getDb(MongoTemplate.java:964) at org.springframework.data.mongodb.core.MongoTemplate.execute(MongoTemplate.java:312) at org.springframework.data.mongodb.core.MongoTemplate.getCollection(MongoTemplate.java:365)
auth: bad nonce received or getnonce not called. could be a driver bug or a security attack
Am I supposed to provide synchronization to this method from my own code? The documentation does not say it's not thread safe.
Has anyone come across this issue?
Also, I have made a sample program to reproduce this problem (attachment). Just import it to your favourite IDE, fill out the applicationContext.xml regarding the mongodb credentials and the collection name to query and finally launch the main method.
Regs,
Innar


Reply With Quote
