title: Symfony + Doctrine ODM "The class was not found in the chain configured namespaces CoreBundle/Document"
body: <p>I can't find what is causing this issue. I have a bundle called CoreBundle (src/CoreBundle) and there is an Entity directory in it (src/CoreBundle/Entity). The directory stores all the entities. For now there is only User Entity (src/CoreBundle/Entity/User.php). Here are the contents:</p>
  
  <p>
  
  <pre><code>namespace Mokapot\CoreBundle\Entity;
  
  use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;
  use Symfony\Component\Security\Core\User\UserInterface;
  
  /**
   * @MongoDB\Document(collection="users")
   */
  class User implements UserInterface {
  
      /**
       * @MongoDB\Id
       */
      protected $id;
  
      /**
       * @MongoDB\String
       */
      protected $username;
  
      /**
       * @MongoDB\String
       */
      protected $password;
  
      /**
       * @MondoDB\Collection
       */
      private $roles;
  
      public function getRoles() {
          $roles = $this-&gt;roles;
          if(empty($roles)) {
              $roles = ['ROLE_USER'];
          }
          return array_unique($roles);
      }
  
      public function setRoles(array $roles) {
          $this-&gt;roles = $roles;
      }
  
      public function getSalt() {
          return;
      }
  
      public function eraseCredentials() {
  
      }
  
      public function getId() {
          return $this-&gt;id;
      }
  
      public function setId($id) {
          $this-&gt;id = $id;
      }
  
      public function getUsername() {
          return $this-&gt;username;
      }
  
      public function setUsername($username) {
          $this-&gt;username = $username;
      }
  
      public function getPassword() {
          return $this-&gt;password;
      }
  
      public function setPassword($password) {
          $this-&gt;password = $password;
      }
  
  }
  </code></pre>
  
  <p>Here is my config.yml for doctrine:</p>
  
  <pre><code>doctrine_mongodb:
      connections:
          default:
              server: "%dbhost%"
              options: {}
      document_managers:
          default:
              database: "%dbname%"
              auto_mapping: false
              mappings:
                  CoreBundle:
                      mapping: true
                      type: annotation
                      dir: Entity
                      prefix:               ~
                      alias:                ~
                      is_bundle: true
  </code></pre>
  
  <p>EDIT: Changed the title.</p>