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

Google Groups | Tom | 1 year ago
  1. 0

    Problems when persisting pojos with propertiets of delcared type "java.lang.Object"

    Google Groups | 1 year ago | Tom
    java.lang.RuntimeException: java.lang.ClassCastException: java.lang.String cannot be cast to com.mongodb.DBObject
  2. 0

    When using $elemMatch on an array field, Fongo tries to cast every item to DBObject, and throws an exception

    GitHub | 2 years ago | shaikap
    java.lang.ClassCastException: java.lang.String cannot be cast to com.mongodb.DBObject
  3. 0

    See PR for test case. Here is the stack trace: {code} ests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.772 sec <<< FAILURE! - in org.hibernate.ogm.datastore.mongodb.test.id.embeddedid.EmbeddedIdTest listAllEntitiesWithEmbeddedId(org.hibernate.ogm.datastore.mongodb.test.id.embeddedid.EmbeddedIdTest) Time elapsed: 0.696 sec <<< ERROR! java.lang.ClassCastException: java.lang.String cannot be cast to com.mongodb.DBObject at org.hibernate.ogm.datastore.mongodb.dialect.impl.MongoDBTupleSnapshot.getKeyColumnValue(MongoDBTupleSnapshot.java:81) at org.hibernate.ogm.datastore.mongodb.dialect.impl.MongoDBTupleSnapshot.get(MongoDBTupleSnapshot.java:75) at org.hibernate.ogm.model.spi.Tuple.get(Tuple.java:50) at org.hibernate.ogm.type.descriptor.impl.BasicGridExtractor.extract(BasicGridExtractor.java:36) at org.hibernate.ogm.type.impl.AbstractGenericBasicType.nullSafeGet(AbstractGenericBasicType.java:226) at org.hibernate.ogm.type.impl.AbstractGenericBasicType.nullSafeGet(AbstractGenericBasicType.java:222) at org.hibernate.ogm.type.impl.AbstractGenericBasicType.nullSafeGet(AbstractGenericBasicType.java:213) at org.hibernate.ogm.type.impl.AbstractGenericBasicType.hydrate(AbstractGenericBasicType.java:313) at org.hibernate.ogm.type.impl.ComponentType.hydrate(ComponentType.java:96) at org.hibernate.ogm.type.impl.ComponentType.nullSafeGet(ComponentType.java:42) at org.hibernate.ogm.loader.impl.OgmLoader.extractKeysFromResultSet(OgmLoader.java:543) at org.hibernate.ogm.loader.impl.OgmLoader.getRowFromResultSet(OgmLoader.java:487) at org.hibernate.ogm.loader.impl.OgmLoader.doQuery(OgmLoader.java:371) at org.hibernate.ogm.loader.impl.OgmLoader.doQueryAndInitializeNonLazyCollections(OgmLoader.java:281) at org.hibernate.ogm.loader.impl.OgmLoader.loadEntity(OgmLoader.java:200) at org.hibernate.ogm.loader.impl.OgmLoader.loadEntities(OgmLoader.java:218) at org.hibernate.ogm.query.impl.OgmQueryLoader.listOfEntities(OgmQueryLoader.java:90) at org.hibernate.ogm.query.impl.OgmQueryLoader.list(OgmQueryLoader.java:76) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:501) at org.hibernate.ogm.query.impl.OgmQueryTranslator.list(OgmQueryTranslator.java:127) at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:220) at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1268) at org.hibernate.internal.QueryImpl.list(QueryImpl.java:87) at org.hibernate.ogm.datastore.mongodb.test.id.embeddedid.EmbeddedIdTest.listAllEntitiesWithEmbeddedId(EmbeddedIdTest.java:35) Results : Tests in error: EmbeddedIdTest.listAllEntitiesWithEmbeddedId:35 » ClassCast java.lang.String c... {code}

    Hibernate JIRA | 1 year ago | Alexander Morozov
    java.lang.ClassCastException: java.lang.String cannot be cast to com.mongodb.DBObject
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    See PR for test case. Here is the stack trace: {code} ests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.772 sec <<< FAILURE! - in org.hibernate.ogm.datastore.mongodb.test.id.embeddedid.EmbeddedIdTest listAllEntitiesWithEmbeddedId(org.hibernate.ogm.datastore.mongodb.test.id.embeddedid.EmbeddedIdTest) Time elapsed: 0.696 sec <<< ERROR! java.lang.ClassCastException: java.lang.String cannot be cast to com.mongodb.DBObject at org.hibernate.ogm.datastore.mongodb.dialect.impl.MongoDBTupleSnapshot.getKeyColumnValue(MongoDBTupleSnapshot.java:81) at org.hibernate.ogm.datastore.mongodb.dialect.impl.MongoDBTupleSnapshot.get(MongoDBTupleSnapshot.java:75) at org.hibernate.ogm.model.spi.Tuple.get(Tuple.java:50) at org.hibernate.ogm.type.descriptor.impl.BasicGridExtractor.extract(BasicGridExtractor.java:36) at org.hibernate.ogm.type.impl.AbstractGenericBasicType.nullSafeGet(AbstractGenericBasicType.java:226) at org.hibernate.ogm.type.impl.AbstractGenericBasicType.nullSafeGet(AbstractGenericBasicType.java:222) at org.hibernate.ogm.type.impl.AbstractGenericBasicType.nullSafeGet(AbstractGenericBasicType.java:213) at org.hibernate.ogm.type.impl.AbstractGenericBasicType.hydrate(AbstractGenericBasicType.java:313) at org.hibernate.ogm.type.impl.ComponentType.hydrate(ComponentType.java:96) at org.hibernate.ogm.type.impl.ComponentType.nullSafeGet(ComponentType.java:42) at org.hibernate.ogm.loader.impl.OgmLoader.extractKeysFromResultSet(OgmLoader.java:543) at org.hibernate.ogm.loader.impl.OgmLoader.getRowFromResultSet(OgmLoader.java:487) at org.hibernate.ogm.loader.impl.OgmLoader.doQuery(OgmLoader.java:371) at org.hibernate.ogm.loader.impl.OgmLoader.doQueryAndInitializeNonLazyCollections(OgmLoader.java:281) at org.hibernate.ogm.loader.impl.OgmLoader.loadEntity(OgmLoader.java:200) at org.hibernate.ogm.loader.impl.OgmLoader.loadEntities(OgmLoader.java:218) at org.hibernate.ogm.query.impl.OgmQueryLoader.listOfEntities(OgmQueryLoader.java:90) at org.hibernate.ogm.query.impl.OgmQueryLoader.list(OgmQueryLoader.java:76) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:501) at org.hibernate.ogm.query.impl.OgmQueryTranslator.list(OgmQueryTranslator.java:127) at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:220) at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1268) at org.hibernate.internal.QueryImpl.list(QueryImpl.java:87) at org.hibernate.ogm.datastore.mongodb.test.id.embeddedid.EmbeddedIdTest.listAllEntitiesWithEmbeddedId(EmbeddedIdTest.java:35) Results : Tests in error: EmbeddedIdTest.listAllEntitiesWithEmbeddedId:35 » ClassCast java.lang.String c... {code}

    Hibernate JIRA | 1 year ago | Alexander Morozov
    java.lang.ClassCastException: java.lang.String cannot be cast to com.mongodb.DBObject
  6. 0

    Serializing / deserializing optionals with Morphia

    Stack Overflow | 6 months ago | jwilner
    java.lang.ClassCastException: java.lang.String cannot be cast to com.mongodb.DBObject

    2 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassCastException

      java.lang.String cannot be cast to com.mongodb.DBObject

      at org.mongodb.morphia.mapping.EmbeddedMapper.fromDBObject()
    2. Morphia
      DatastoreImpl.get
      1. org.mongodb.morphia.mapping.EmbeddedMapper.fromDBObject(EmbeddedMapper.java:162)
      2. org.mongodb.morphia.mapping.EmbeddedMapper.fromDBObject(EmbeddedMapper.java:173)
      3. org.mongodb.morphia.mapping.Mapper.readMappedField(Mapper.java:642)
      4. org.mongodb.morphia.mapping.Mapper.fromDb(Mapper.java:617)
      5. org.mongodb.morphia.mapping.Mapper.fromDBObject(Mapper.java:310)
      6. org.mongodb.morphia.query.MorphiaIterator.convertItem(MorphiaIterator.java:87)
      7. org.mongodb.morphia.query.MorphiaIterator.processItem(MorphiaIterator.java:73)
      8. org.mongodb.morphia.query.MorphiaIterator.next(MorphiaIterator.java:68)
      9. org.mongodb.morphia.query.QueryImpl.get(QueryImpl.java:421)
      10. org.mongodb.morphia.DatastoreImpl.get(DatastoreImpl.java:739)[...]
      10 frames