java.lang.RuntimeException: java.lang.ClassCastException: java.lang.String cannot be cast to com.mongodb.DBObject

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 Google Groups by Tom, 1 year ago
java.lang.ClassCastException: java.lang.String cannot be cast to com.mongodb.DBObject
via GitHub by MilusW
, 1 year ago
java.lang.ClassCastException: java.lang.String cannot be cast to com.mongodb.DBObject
via Stack Overflow by panagdu
, 2 years ago
java.lang.RuntimeException: java.lang.ClassCastException: java.lang.String cannot be cast to com.mongodb.DBObject
via GitHub by yeefan
, 2 years ago
java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType
via Stack Overflow by kn_pavan
, 1 year ago
: java.lang.RuntimeException: org.mongodb.morphia.mapping.MappingException: Error setting value from converter (IdentityConverter) for Doc.expressionTraversalTree to { "levels" : [ { "computeUnits" : [ { "computeType" : "MATH_EVAL" , "mvalExpression" : "doc['__count__'].value + 10" }] , "level" : 0}]}
via Stack Overflow by Vfire
, 3 months ago
java.lang.ClassCastException: org.bson.types.ObjectId cannot be cast to com.mongodb.DBObject
java.lang.ClassCastException: java.lang.String cannot be cast to com.mongodb.DBObject
at org.mongodb.morphia.mapping.EmbeddedMapper.fromDBObject(EmbeddedMapper.java:162)
at org.mongodb.morphia.mapping.EmbeddedMapper.fromDBObject(EmbeddedMapper.java:173)
at org.mongodb.morphia.mapping.Mapper.readMappedField(Mapper.java:642)
at org.mongodb.morphia.mapping.Mapper.fromDb(Mapper.java:617)
at org.mongodb.morphia.mapping.Mapper.fromDBObject(Mapper.java:310)
at org.mongodb.morphia.query.MorphiaIterator.convertItem(MorphiaIterator.java:87)
at org.mongodb.morphia.query.MorphiaIterator.processItem(MorphiaIterator.java:73)
at org.mongodb.morphia.query.MorphiaIterator.next(MorphiaIterator.java:68)
at org.mongodb.morphia.query.QueryImpl.get(QueryImpl.java:421)
at org.mongodb.morphia.DatastoreImpl.get(DatastoreImpl.java:739)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago

Write tip

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