-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
None
-
Affects Version/s: 2.12.1
-
Component/s: Write Operations
-
None
-
Environment:Linux ip-172-31-7-155 3.13.0-29-generic #53-Ubuntu SMP
MongoDB shell version: 2.6.3
-
None
-
None
-
None
-
None
-
None
-
None
-
None
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]
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
{
"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
}