org.springframework.dao.DuplicateKeyException: { "serverUsed" : “[…]” , "ok" : 1 , "n" : 0 , "err" : "insertDocument :: caused by :: 11000 E11000 duplicate key error index: […].$_id_ dup key: { : ObjectId('[…]') }" , "code" : 11000}; nested exception is com.mongodb.MongoException$DuplicateKey: { "serverUsed" : "[…]" , "ok" : 1 , "n" : 0 , "err" : "insertDocument :: caused by :: 11000 E11000 duplicate key error index: […].$_id_ dup key: { : ObjectId('[…]') }" , "code" : 11000}

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Spring JIRA by Nathan Cantelmo, 1 year ago
{ "serverUsed" : “[…]” , "ok" : 1 , "n" : 0 , "err" : "insertDocument :: caused by :: 11000 E11000 duplicate key error index: […].$_id_ dup key: { : ObjectId('[…]') }" , "code" : 11000}; nested exception is com.mongodb.MongoException$DuplicateKey
via Spring JIRA by Nathan Cantelmo, 1 year ago
{ "serverUsed" : “[…]” , "ok" : 1 , "n" : 0 , "err" : "insertDocument :: caused by :: 11000 E11000 duplicate key error index: […].$_id_ dup key: { : ObjectId('[…]') }" , "code" : 11000}; nested exception is com.mongodb.MongoException$DuplicateKey
via GitHub by tkruse
, 2 years ago
{ "serverUsed" : "localhost:27017" , "ok" : 1.0 , "err" : "E11000 duplicate key error index: foo_idx dup key : {[[5501b92f44aeab6043550e9b]] }" , "code" : 11001}; nested exception is com.mongodb.MongoException$DuplicateKey: { "serverUsed
via Stack Overflow by Bruce
, 1 year ago
Write failed with error code 11000 and error message 'E11000 duplicate key error collection: 56cbfbd323f5496dcc02c579.delivery_orders index: _id_ dup key: { : ObjectId('56d6b81623f54966b07b0587') }'; nested exception is
via Stack Overflow by biliboc
, 1 year ago
E11000 duplicate key error index: sytrue.ngram.$_id_ dup key: { : "page two" }; nested exception is com.mongodb.MongoException$DuplicateKey: E11000 duplicate key error index: sytrue.ngram.$_id_ dup key: { : "page two" }
via Stack Overflow by Jag
, 1 year ago
Write failed with error code 11000 and error message 'E11000 duplicate key error collection: msgdb.roster index: _id_ dup key: { : "sn88332138" }'; nested exception is com.mongodb.DuplicateKeyException: Write failed with error code 11000 and error message 'E11000 duplicate key error collection: msgdb.roster index: _id_ dup key: { : "sn88332138" }'
org.springframework.dao.DuplicateKeyException: { "serverUsed" : “[…]” , "ok" : 1 , "n" : 0 , "err" : "insertDocument :: caused by :: 11000 E11000 duplicate key error index: […].$_id_ dup key: { : ObjectId('[…]') }" , "code" : 11000}; nested exception is com.mongodb.MongoException$DuplicateKey: { "serverUsed" : "[…]" , "ok" : 1 , "n" : 0 , "err" : "insertDocument :: caused by :: 11000 E11000 duplicate key error index: […].$_id_ dup key: { : ObjectId('[…]') }" , "code" : 11000}
at org.springframework.data.mongodb.core.MongoExceptionTranslator.translateExceptionIfPossible(MongoExceptionTranslator.java:55)
at org.springframework.data.mongodb.core.MongoTemplate.potentiallyConvertRuntimeException(MongoTemplate.java:1918)
at org.springframework.data.mongodb.core.MongoTemplate.execute(MongoTemplate.java:412)
at org.springframework.data.mongodb.core.MongoTemplate.insertDBObject(MongoTemplate.java:895)
at org.springframework.data.mongodb.core.MongoTemplate.doInsert(MongoTemplate.java:717)
at org.springframework.data.mongodb.core.MongoTemplate.doSaveVersioned(MongoTemplate.java:850)
at org.springframework.data.mongodb.core.MongoTemplate.save(MongoTemplate.java:837)

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.

Know the solutions? Share your knowledge to help other developers to debug faster.