title: Symfony2.1 mapping error: class_parents()
body: <p>I have a problem trying to get data from a table (via entity) using Doctrine2 in a Symfony2.1 project. Here is the controller where I get the error:</p>
  
  <pre><code>/**
   * Country list
   */
  public function countrylistAction()
  {
      $em = $this-&gt;getDoctrine()-&gt;getManager();
      $countryList = $em-&gt;getRepository('ProjectBaseBundle:SYS_TCountry')
          -&gt;findAll();
  
      $serializer = new Serializer(array(new GetSetMethodNormalizer()),
          array('json' =&gt; new JsonEncoder()));
  
      return new Response($serializer-&gt;serialize($countryList, 'json'));
  }
  </code></pre>
  
  <p>The entity:</p>
  
  <pre><code>&lt;?php
  
  namespace Company\Project\BaseBundle\Entity;
  
  use Doctrine\ORM\Mapping as ORM;
  use Symfony\Component\Validator\Constraints as Assert;
  
  /**
   * @ORM\Entity
   * @ORM\Table(name="SYS_TCountry")
   */
  class SYS_TCountry
  {
      /**
       * @ORM\Id
       * @ORM\Column(type="string", length=3, nullable=false)
       * @var string
       */
      protected $idcountry;
  
      /**
       * @ORM\Column(type="string", length=75, nullable=false)
       * @Assert\NotBlank()
       * @var string
       */
      protected $name;
  
      ....
  
      public function getIdcountry()              { return $this-&gt;idcountry; }
      public function getName()                   { return $this-&gt;name; }
      public function getA2()                     { return $this-&gt;a2; }
      public function getA3()                     { return $this-&gt;a3; }
      public function getIdstatus()               { return $this-&gt;idstatus; }
      public function setIdcountry($idcountry)    { $this-&gt;idcountry = $idcountry; }
      public function setName($name)              { $this-&gt;name = $name; }
      public function setA2($a2)                  { $this-&gt;a2 = $a2; }
      public function setA3($a3)                  { $this-&gt;a3 = $a3; }
      public function setIdstatus($idstatus)      { $this-&gt;idstatus = $idstatus; }
  
      public function __toString()                { return $this-&gt;idcountry; }
  
  }
  </code></pre>
  
  <p>Config.yml:</p>
  
  <pre><code># Doctrine Configuration
  doctrine:
      dbal:
          driver:   %database_driver%
          host:     %database_host%
          port:     %database_port%
          dbname:   %database_name%
          user:     %database_user%
          password: %database_password%
          charset:  UTF8
  
      orm:
          auto_generate_proxy_classes: %kernel.debug%
          auto_mapping: true
  </code></pre>
  
  <p>And this is the error:</p>
  
  <pre><code>Warning: class_parents(): 
  Class Company\Project\BaseBundle\Entity\SYS_TCountry does not exist and could not be loaded in 
  /var/www/project/src/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php line 40
  </code></pre>
  
  <p>It is strange because, as Doctrine says in console, the mapping is properly done: I test it executing <em>php app/console doctrine:mapping:info</em>:</p>
  
  <pre><code>[OK]   Company\Project\BaseBundle\Entity\SYS_TCountry
  </code></pre>
  
  <p>and if I execute a query in console everything goes fine -> app/console doctrine:query:sql 'SELECT * FROM SYS_TCountry', that return results.</p>
  
  <p>I do not know if using <strong>Symfony2.1</strong> I have to configure something different to the 2.0 version, but seems the same because the mapping is Doctrine responsibility.</p>