-
Type: Bug
-
Resolution: Duplicate
-
Priority: Minor - P4
-
None
-
Affects Version/s: 2.7.2
-
Component/s: API
-
None
Code:
Mongo mongo = new Mongo(); DB db = mongo.getDB("wendal_test"); DBCollection ps = db.getCollection("person"); ps.drop(); BasicDBObject obj = new BasicDBObject(); obj.append("wendal", new Symbol("http://wendal.net")); ps.save(obj); System.out.println(obj.toString());
throw RuntimeException:
Exception in thread "Main Thread" java.lang.RuntimeException: json can't serialize type : class org.bson.types.Symbol at com.mongodb.util.JSON.serialize(JSON.java:261) at com.mongodb.util.JSON.serialize(JSON.java:141) at com.mongodb.util.JSON.serialize(JSON.java:58) at com.mongodb.BasicDBObject.toString(BasicDBObject.java:84) at org.nutz.ztask.AllZTask.main(AllZTask.java:35)
- duplicates
-
JAVA-478 DBObject.toString raises RuntimeException when the object contains Symbol
- Closed