title: Symfony: The class XYZ was not found in the chain configured namespaces
body: <p>Existing questions did not help.
  I am still learning Symfony and setting up an existing project. Trying to run doctrine fixtures from my application directory. </p>
  
  <pre><code>./app/console doctrine:fixtures:load --env test
  </code></pre>
  
  <p>And running this gives me following errors</p>
  
  <blockquote>
    <p>Error thrown while running command "doctrine:fixtures:load --env test --em default". Message: "The class 'ClientPortal\GenericBundle\Document\Accountant' was not found in the chain configured namespaces _XyzProjectName\CalendarContext\Domain\Model, Integration\GetFeedbackBundle\Model, _XyzProjectName\AccountingProcessContext\Domain\Model, _XyzProjectName\CaseContext\Domain" {"exception":"[object] (Doctrine\Common\Persistence\Mapping\MappingException(code: 0): The class 'ClientPortal\GenericBundle\Document\Accountant' was not found in the chain configured namespaces _XyzProjectName\CalendarContext\Domain\Model, Integration\GetFeedbackBundle\Model, _XyzProjectName\AccountingProcessContext\Domain\Model, _XyzProjectName\CaseContext\Domain at /usr/local/var/www/1800-api/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Mapping/MappingException.php:22)</p>
  </blockquote>
  
  <p>And this exception is being thrown when trying to persist object of class </p>
  
  <blockquote>
    <p>'ClientPortal\GenericBundle\Document\Accountant'</p>
  </blockquote>
  
  <p>and here is my doctrine in config.yml</p>
  
  <pre><code>doctrine:
  dbal:
      driver:   pdo_pgsql
      host:     '%database_host%'
      dbname:   '%database_name%'
      user:     '%database_user%'
      password: '%database_password%'
  orm:
      auto_generate_proxy_classes: "%kernel.debug%"
      auto_mapping: true
      mappings:
          CalendarBundle:
              prefix: '_XyzProjectName\CalendarContext\Domain\Model'
          IntegrationGetFeedbackBundle:
              prefix: 'Integration\GetFeedbackBundle\Model'
          AccountingProcessBundle:
              prefix: '_XyzProjectName\AccountingProcessContext\Domain\Model'
          CaseBundle:
              prefix: '_XyzProjectName\CaseContext\Domain'
          GenericBundle:
              type: "annotation"   
              prefix: 'ClientPortal\GenericBundle\Document'
              dir: 'src'
              is_bundle: false
  </code></pre>
  
  <p>The snippet which is raising this exception </p>
  
  <pre><code>    $account = new ClientPortal\GenericBundle\Document\Accountant();//full namespace added for clarity - also this file lies in the same directory structure. 
      $account-&gt;setSfAccountantId($accountantId);
      $account-&gt;setUsername($username);
      $manager = new ObjectManager;
      $manager-&gt;persist( $account ); //This throws the above mentioned exception
  </code></pre>
  
  <p>My thought is, the file ClientPortal\GenericBundle\Document\Accountant.php is being autoloaded as there is no exception thrown at the time of instantion of its object. But, there is something missing with configuration or mapping because of which doctrine does not know how to persist its object. </p>
  
  <p>[Source code][1] Accountant class</p>
  
  <p>GenericBundle(s) registered under AppKernel</p>
  
  <pre><code>new Website\GenericBundle\WebsiteGenericBundle(),
  new Admin\GenericBundle\AdminGenericBundle(),
  new ClientPortal\GenericBundle\ClientPortalGenericBundle(),
  new TaxApp\GenericBundle\TaxAppGenericBundle(),
  </code></pre>