title: Can´t create entity in MongoDB
body: <p>I am brand new to MongoDB, so sorry if the question is basic. </p>
  
  <p>I am trying to get a basic CRUD working with Java basic objects (POJOs), but this code fails. (What is the correct way of doing this? I think it might be close to this):</p>
  
  <pre><code>BasicDBObject document = new BasicDBObject();
  document.put("name", user);
  dbCollection.insert(document);
  </code></pre>
  
  <p>This is the message I am getting: </p>
  
  <pre><code>Exception in thread "main" java.lang.IllegalArgumentException: can't serialize class entities.users.NormalUser
      at org.bson.BasicBSONEncoder._putObjectField(BasicBSONEncoder.java:270)
      at org.bson.BasicBSONEncoder.putObject(BasicBSONEncoder.java:174)
      at org.bson.BasicBSONEncoder.putObject(BasicBSONEncoder.java:120)
      at com.mongodb.DefaultDBEncoder.writeObject(DefaultDBEncoder.java:27)
      at com.mongodb.OutMessage.putObject(OutMessage.java:289)
      at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:261)
      at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:226)
      at com.mongodb.DBCollection.insert(DBCollection.java:75)
      at com.mongodb.DBCollection.insert(DBCollection.java:59)
      at com.mongodb.DBCollection.insert(DBCollection.java:104)
      at repositories.UsersRepository.createUser(UsersRepository.java:53)
      at repositories.UsersRepository.main(UsersRepository.java:90)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
  </code></pre>