org.springframework.data.mapping.model.MappingException

Cannot use a complex object as a key value.

Samebug tips0

There are no available Samebug tips for this exception. If you know how to solve this issue, help other users by writing a short tip.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web15

  • via Spring JIRA by Alexander Bätz, 11 months ago
    Cannot use a complex object as a key value.
  • Cannot use a complex object as a key value.
  • via Spring JIRA by Alexander Bätz, 1 year ago
    Cannot use a complex object as a key value.
  • Stack trace

    • org.springframework.data.mapping.model.MappingException: Cannot use a complex object as a key value. at org.springframework.data.mongodb.core.convert.MappingMongoConverter.writeMapInternal(MappingMongoConverter.java:525)[spring-data-mongodb-1.0.2.RELEASE.jar:na] at org.springframework.data.mongodb.core.convert.MappingMongoConverter.writePropertyInternal(MappingMongoConverter.java:385)[spring-data-mongodb-1.0.2.RELEASE.jar:na] at org.springframework.data.mongodb.core.convert.MappingMongoConverter$3.doWithPersistentProperty(MappingMongoConverter.java:346)[spring-data-mongodb-1.0.2.RELEASE.jar:na] at org.springframework.data.mongodb.core.convert.MappingMongoConverter$3.doWithPersistentProperty(MappingMongoConverter.java:335)[spring-data-mongodb-1.0.2.RELEASE.jar:na] at org.springframework.data.mapping.model.BasicPersistentEntity.doWithProperties(BasicPersistentEntity.java:173)[spring-data-commons-core-1.2.1.RELEASE.jar:na] at org.springframework.data.mongodb.core.convert.MappingMongoConverter.writeInternal(MappingMongoConverter.java:335)[spring-data-mongodb-1.0.2.RELEASE.jar:na] at org.springframework.data.mongodb.core.convert.MappingMongoConverter.writeInternal(MappingMongoConverter.java:307)[spring-data-mongodb-1.0.2.RELEASE.jar:na] at org.springframework.data.mongodb.core.convert.MappingMongoConverter.write(MappingMongoConverter.java:272)[spring-data-mongodb-1.0.2.RELEASE.jar:na] at org.springframework.data.mongodb.core.convert.MappingMongoConverter.write(MappingMongoConverter.java:73)[spring-data-mongodb-1.0.2.RELEASE.jar:na] at org.springframework.data.mongodb.core.MongoTemplate.doSave(MongoTemplate.java:718)[spring-data-mongodb-1.0.2.RELEASE.jar:na] at org.springframework.data.mongodb.core.MongoTemplate.save(MongoTemplate.java:708)[spring-data-mongodb-1.0.2.RELEASE.jar:na] at org.springframework.data.mongodb.core.MongoTemplate.save(MongoTemplate.java:704)[spring-data-mongodb-1.0.2.RELEASE.jar:na] at net.bigpoint.globalchat.hazelcast.MongoMapStore.store(MongoMapStore.java:86)[classes/:na] at net.bigpoint.globalchat.hazelcast.MongoMapStore.store(MongoMapStore.java:1)[classes/:na] at com.hazelcast.impl.concurrentmap.MapStoreWrapper.store(MapStoreWrapper.java:114)[hazelcast-2.1.2.jar:2.1.2] at com.hazelcast.impl.ConcurrentMapManager$PutOperationHandler$PutStorer.doMapStoreOperation(ConcurrentMapManager.java:2853)[hazelcast-2.1.2.jar:2.1.2] at com.hazelcast.impl.ConcurrentMapManager$AbstractMapStoreOperation.run(ConcurrentMapManager.java:3560)[hazelcast-2.1.2.jar:2.1.2] at com.hazelcast.impl.executor.ParallelExecutorService$ParallelExecutorImpl$ExecutionSegment.run(ParallelExecutorService.java:212)[hazelcast-2.1.2.jar:2.1.2] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)[na:1.7.0_04] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)[na:1.7.0_04] at java.lang.Thread.run(Thread.java:722)[na:1.7.0_04]

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    You’re the first here who have seen this exception.