title: Zend Framework 2 + Doctrine ODM, "The Class was not found in the chain configured namespaces" error?
body: <p>When setting up ZF2 + ODM, I'm getting the following error:</p>
  
  <pre><code>The class 'Application\Document\User' was not found in the chain configured namespaces 
  </code></pre>
  
  <p>The current setup is as the following:</p>
  
  <p>ZF2 stable, installed doctrine ODM via composer.phar with content of composer.json</p>
  
  <pre><code>{
      "name": "zendframework/skeleton-application",
      "description": "Skeleton Application for ZF2",
      "license": "BSD-3-Clause",
      "keywords": [
          "framework",
          "zf2"
      ],
      "homepage": "http://framework.zend.com/",
      "minimum-stability": "dev",
      "require": {
          "php": "&gt;=5.3.3",
          "zendframework/zendframework": "2.0.0",
          "doctrine/doctrine-mongo-odm-module": "dev-master"
      }
  }
  </code></pre>
  
  <p>modules loaded</p>
  
  <pre><code>'modules' =&gt; array(
      'Application',
      'DoctrineModule',
      'DoctrineMongoODMModule',
  ),
  </code></pre>
  
  <p>hydrator and proxy dirs are created</p>
  
  <pre><code>$ ls -l data/DoctrineMongoODMModule/
  total 0
  drwxrwxrwx  2 wisu  staff  68 Sep 12 08:34 Hydrators
  drwxrwxrwx  2 wisu  staff  68 Sep 12 08:35 Proxy
  </code></pre>
  
  <p>the odm config looks like</p>
  
  <pre><code>'driver' =&gt; array(
      'odm_default' =&gt; array(
          'drivers' =&gt; array(
              'Application\Document' =&gt; 'aplikasi'
          )
      ),
      'aplikasi' =&gt; array(
          'class' =&gt; 'Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver',
          'cache' =&gt; 'array',
          'paths' =&gt; array(
              'module/Application/src/Application/Document'
          )
      )
  ),
  </code></pre>
  
  <p>I'm trying to use the following mapping</p>
  
  <pre><code>&lt;?php
  
  namespace Application\Document;
  
  use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
  
  /** @ODM\Document(collection="user") */
  class User
  {
      /** @ODM\Id */
      private $id;
  
      /** @ODM\Field(type="string") */
      private $name;
  
      /**
       * @return the $id
       */
      public function getId() {
          return $this-&gt;id;
      }
  
      /**
       * @return the $name
       */
      public function getName() {
          return $this-&gt;name;
      }
  
      /**
       * @param field_type $id
       */
      public function setId($id) {
          $this-&gt;id = $id;
      }
  
      /**
       * @param field_type $name
       */
      public function setName($name) {
          $this-&gt;name = $name;
      }
  
  }
  </code></pre>
  
  <p>but calling it via</p>
  
  <pre><code>&lt;?php
  
  namespace Application\Controller;
  
  use Zend\Mvc\Controller\AbstractActionController;
  use Zend\View\Model\ViewModel;
  use Application\Document\User;
  
  class IndexController extends AbstractActionController
  {
      public function indexAction()
      {
  
          $dm = $this-&gt;getServiceLocator()-&gt;get('doctrine.documentmanager.odm_default');
  
          $user = new User();
          $user-&gt;setName("Gembul");
  
          $dm-&gt;persist($user);
          $dm-&gt;flush();
  
          return new ViewModel();
      }
  }
  </code></pre>
  
  <p>Any pointers?</p>