Uploaded image for project: 'Spring Data MongoDB'
  1. Spring Data MongoDB
  2. DATAMONGO-1002

Update.toString(…) might throw exception

    Details

      Description

      The toString(…) method on Update class is breaking when there are custom mappings used for e.g., Joda DateTime. I think this is falling back to driver's JSON serializer rather than using Spring Data MongoDB mappings. The following is stacktrace.

      java.lang.RuntimeException: json can't serialize type : class org.joda.time.DateTime
      	at com.mongodb.util.ClassMapBasedObjectSerializer.serialize(ClassMapBasedObjectSerializer.java:77)
      	at com.mongodb.util.JSONSerializers$MapSerializer.serialize(JSONSerializers.java:317)
      	at com.mongodb.util.ClassMapBasedObjectSerializer.serialize(ClassMapBasedObjectSerializer.java:79)
      	at com.mongodb.util.JSONSerializers$MapSerializer.serialize(JSONSerializers.java:317)
      	at com.mongodb.util.ClassMapBasedObjectSerializer.serialize(ClassMapBasedObjectSerializer.java:79)
      	at com.mongodb.util.JSON.serialize(JSON.java:55)
      	at com.mongodb.util.JSON.serialize(JSON.java:40)
      	at com.mongodb.BasicDBObject.toString(BasicDBObject.java:83)
      	at org.springframework.data.mongodb.core.query.Update.toString(Update.java:375)
      	at 
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                olivergierke Oliver Gierke
                Reporter:
                poornasubhash Poorna Subhash
                Last updater:
                Oliver Gierke
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: