java.lang.RuntimeException: json can't serialize type : class org.joda.time.DateTime

Spring JIRA | Poorna Subhash | 3 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    [DATAMONGO-1002] Update.toString(…) might throw exception - Spring JIRA

    spring.io | 1 year ago
    java.lang.RuntimeException: json can't serialize type : class org.joda.time.DateTime
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    {noformat} java.lang.RuntimeException: json can't serialize type : class com.viditure.entities.DocRecipient at com.mongodb.util.ClassMapBasedObjectSerializer.serialize(ClassMapBasedObjectSerializer.java:77) ~[mongo-java-driver-2.12.1.jar:na] at com.mongodb.util.JSONSerializers$MapSerializer.serialize(JSONSerializers.java:317) ~[mongo-java-driver-2.12.1.jar:na] at com.mongodb.util.ClassMapBasedObjectSerializer.serialize(ClassMapBasedObjectSerializer.java:79) ~[mongo-java-driver-2.12.1.jar:na] at com.mongodb.util.JSONSerializers$MapSerializer.serialize(JSONSerializers.java:317) ~[mongo-java-driver-2.12.1.jar:na] at com.mongodb.util.ClassMapBasedObjectSerializer.serialize(ClassMapBasedObjectSerializer.java:79) ~[mongo-java-driver-2.12.1.jar:na] at com.mongodb.util.JSON.serialize(JSON.java:55) ~[mongo-java-driver-2.12.1.jar:na] at com.mongodb.util.JSON.serialize(JSON.java:40) ~[mongo-java-driver-2.12.1.jar:na] at com.mongodb.BasicDBObject.toString(BasicDBObject.java:83) ~[mongo-java-driver-2.12.1.jar:na] at org.springframework.data.mongodb.core.query.Update.toString(Update.java:375) ~[spring-data-mongodb-1.5.1.RELEASE.jar:na] at java.util.Formatter$FormatSpecifier.printString(Formatter.java:2838) ~[na:1.7.0_55] at java.util.Formatter$FormatSpecifier.print(Formatter.java:2718) ~[na:1.7.0_55] at java.util.Formatter.format(Formatter.java:2488) ~[na:1.7.0_55] at java.util.Formatter.format(Formatter.java:2423) ~[na:1.7.0_55] at java.lang.String.format(String.java:2797) ~[na:1.7.0_55] {noformat} In the operation we are trying to perform 'DocRecipient' , a POJO, is being updated in the main document through a findAndModify call. Initial creation of the document had no issues and many documents with other DocRecipients are successfully created and updated - but on the cases where they fail they consistently with the stack trace above JSON of the sample document which failed is shown below : it looks no different than the ones which pass. the JSON was printed in log using jackson {noformat} { "state" : "SEEN", "_id" : "547bd935e4b0ee388a96ad0d", "fullName" : "haksdfj", "email" : "xyz@gmail.com", "token" : "547bd935e4b0ee388a96ad0e", "signRequired" : false, "fieldInputs" : [ { "fieldPosition" : "0.0", "state" : "NOTFILLED" }, { "fieldPosition" : "0.1", "state" : "NOTFILLED" } ], "readOutMessage" : "I haksdfj agree to ....", "videoDuration" : 10, "timeAccessed" : 1417560518713 } {noformat}

    JIRA | 2 years ago | Manoj Kurup
    java.lang.RuntimeException: json can't serialize type : class com.viditure.entities.DocRecipient
  4. 0

    {noformat} java.lang.RuntimeException: json can't serialize type : class com.viditure.entities.DocRecipient at com.mongodb.util.ClassMapBasedObjectSerializer.serialize(ClassMapBasedObjectSerializer.java:77) ~[mongo-java-driver-2.12.1.jar:na] at com.mongodb.util.JSONSerializers$MapSerializer.serialize(JSONSerializers.java:317) ~[mongo-java-driver-2.12.1.jar:na] at com.mongodb.util.ClassMapBasedObjectSerializer.serialize(ClassMapBasedObjectSerializer.java:79) ~[mongo-java-driver-2.12.1.jar:na] at com.mongodb.util.JSONSerializers$MapSerializer.serialize(JSONSerializers.java:317) ~[mongo-java-driver-2.12.1.jar:na] at com.mongodb.util.ClassMapBasedObjectSerializer.serialize(ClassMapBasedObjectSerializer.java:79) ~[mongo-java-driver-2.12.1.jar:na] at com.mongodb.util.JSON.serialize(JSON.java:55) ~[mongo-java-driver-2.12.1.jar:na] at com.mongodb.util.JSON.serialize(JSON.java:40) ~[mongo-java-driver-2.12.1.jar:na] at com.mongodb.BasicDBObject.toString(BasicDBObject.java:83) ~[mongo-java-driver-2.12.1.jar:na] at org.springframework.data.mongodb.core.query.Update.toString(Update.java:375) ~[spring-data-mongodb-1.5.1.RELEASE.jar:na] at java.util.Formatter$FormatSpecifier.printString(Formatter.java:2838) ~[na:1.7.0_55] at java.util.Formatter$FormatSpecifier.print(Formatter.java:2718) ~[na:1.7.0_55] at java.util.Formatter.format(Formatter.java:2488) ~[na:1.7.0_55] at java.util.Formatter.format(Formatter.java:2423) ~[na:1.7.0_55] at java.lang.String.format(String.java:2797) ~[na:1.7.0_55] {noformat} In the operation we are trying to perform 'DocRecipient' , a POJO, is being updated in the main document through a findAndModify call. Initial creation of the document had no issues and many documents with other DocRecipients are successfully created and updated - but on the cases where they fail they consistently with the stack trace above JSON of the sample document which failed is shown below : it looks no different than the ones which pass. the JSON was printed in log using jackson {noformat} { "state" : "SEEN", "_id" : "547bd935e4b0ee388a96ad0d", "fullName" : "haksdfj", "email" : "xyz@gmail.com", "token" : "547bd935e4b0ee388a96ad0e", "signRequired" : false, "fieldInputs" : [ { "fieldPosition" : "0.0", "state" : "NOTFILLED" }, { "fieldPosition" : "0.1", "state" : "NOTFILLED" } ], "readOutMessage" : "I haksdfj agree to ....", "videoDuration" : 10, "timeAccessed" : 1417560518713 } {noformat}

    JIRA | 2 years ago | Manoj Kurup
    java.lang.RuntimeException: json can't serialize type : class com.viditure.entities.DocRecipient

    3 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.RuntimeException

      json can't serialize type : class org.joda.time.DateTime

      at com.mongodb.util.ClassMapBasedObjectSerializer.serialize()
    2. MongoDB Java Driver
      BasicDBObject.toString
      1. com.mongodb.util.ClassMapBasedObjectSerializer.serialize(ClassMapBasedObjectSerializer.java:77)
      2. com.mongodb.util.JSONSerializers$MapSerializer.serialize(JSONSerializers.java:317)
      3. com.mongodb.util.ClassMapBasedObjectSerializer.serialize(ClassMapBasedObjectSerializer.java:79)
      4. com.mongodb.util.JSONSerializers$MapSerializer.serialize(JSONSerializers.java:317)
      5. com.mongodb.util.ClassMapBasedObjectSerializer.serialize(ClassMapBasedObjectSerializer.java:79)
      6. com.mongodb.util.JSON.serialize(JSON.java:55)
      7. com.mongodb.util.JSON.serialize(JSON.java:40)
      8. com.mongodb.BasicDBObject.toString(BasicDBObject.java:83)
      8 frames
    3. Spring Data MongoDB - Core
      Update.toString
      1. org.springframework.data.mongodb.core.query.Update.toString(Update.java:375)
      1 frame