When I insert a List into mongodb, there is a problem:
Exception in thread \"main\" java.lang.IllegalArgumentException: can\'t serialize class mongodb.Person
Your Person class definition needs to have implements Serializable in order for it to be serialized, e.g.:
Person
implements Serializable
class Person implements Serializable { //Rest here }
Here are some useful links on Java object serialization: Link, Link.