java.lang.RuntimeException: json can't serialize type : class com.viditure.entities.DocRecipient

JIRA | Manoj Kurup | 2 years ago
  1. 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
  2. 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. 0

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

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

    Automated exception search integrated into your IDE

    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 com.viditure.entities.DocRecipient

      at com.mongodb.util.ClassMapBasedObjectSerializer.serialize()
    2. MongoDB Java Driver
      BasicDBObject.toString
      1. com.mongodb.util.ClassMapBasedObjectSerializer.serialize(ClassMapBasedObjectSerializer.java:77)[mongo-java-driver-2.12.1.jar:na]
      2. com.mongodb.util.JSONSerializers$MapSerializer.serialize(JSONSerializers.java:317)[mongo-java-driver-2.12.1.jar:na]
      3. com.mongodb.util.ClassMapBasedObjectSerializer.serialize(ClassMapBasedObjectSerializer.java:79)[mongo-java-driver-2.12.1.jar:na]
      4. com.mongodb.util.JSONSerializers$MapSerializer.serialize(JSONSerializers.java:317)[mongo-java-driver-2.12.1.jar:na]
      5. com.mongodb.util.ClassMapBasedObjectSerializer.serialize(ClassMapBasedObjectSerializer.java:79)[mongo-java-driver-2.12.1.jar:na]
      6. com.mongodb.util.JSON.serialize(JSON.java:55)[mongo-java-driver-2.12.1.jar:na]
      7. com.mongodb.util.JSON.serialize(JSON.java:40)[mongo-java-driver-2.12.1.jar:na]
      8. com.mongodb.BasicDBObject.toString(BasicDBObject.java:83)[mongo-java-driver-2.12.1.jar:na]
      8 frames
    3. Spring Data MongoDB - Core
      Update.toString
      1. org.springframework.data.mongodb.core.query.Update.toString(Update.java:375)[spring-data-mongodb-1.5.1.RELEASE.jar:na]
      1 frame
    4. Java RT
      String.format
      1. java.util.Formatter$FormatSpecifier.printString(Formatter.java:2838)[na:1.7.0_55]
      2. java.util.Formatter$FormatSpecifier.print(Formatter.java:2718)[na:1.7.0_55]
      3. java.util.Formatter.format(Formatter.java:2488)[na:1.7.0_55]
      4. java.util.Formatter.format(Formatter.java:2423)[na:1.7.0_55]
      5. java.lang.String.format(String.java:2797)[na:1.7.0_55]
      5 frames