title: Yet another Unknown Entity namespace alias error (Symfony2, manually created entity)
body: <p>I am having a <code>[Doctrine\ORM\ORMException] Unknown Entity namespace alias 'src\AppBundle\Entity'</code>
  error message.</p>
  
  <p>A quick search led me to three related SO questions :</p>
  
  <p><a href="https://stackoverflow.com/questions/11067797/unknown-entity-namespace-alias-in-symfony2">here</a> about
  a problem in a user-created bundle, which I'm not using here.</p>
  
  <p><a href="https://stackoverflow.com/questions/25842487/silex-and-doctrine-ormexception-unknown-entity-namespace-alias-semi-fixed">here</a> where
  the error message is obtained by PHP code rather using doctrine in the command line as I'm currently doing, and</p>
  
  <p><a href="https://stackoverflow.com/questions/25701669/symfony-production-environment-throws-500-error-doctrine-orm-ormexception-unkn">there</a> where the answer suggests doing  <code>sudo php app/console cache:clear --env=dev</code> ; I did that followed by <code>sudo chmod a+w app/cache/dev/annotations</code>, but the problem stayed the same.</p>
  
  <p>Here is what I did  :</p>
  
  <p>1) Successfully create my database with <code>php app/console doctrine:database:create</code></p>
  
  <p>2) Create manually a Product Entity in <code>app/Entity/Product.php</code> with the following content (the code below is
  copy-pasted from the Symfony Book) :</p>
  
  <pre><code>&lt;?php
  
      namespace AppBundle\Entity;
  
      use Doctrine\ORM\Mapping as ORM;
  
      /**
       * @ORM\Entity
       * @ORM\Table(name="product")
       */
      class Product
      {
          /**
           * @ORM\Column(type="integer")
           * @ORM\Id
           * @ORM\GeneratedValue(strategy="AUTO")
           */
          protected $id;
  
          /**
           * @ORM\Column(type="string", length=100)
           */
          protected $name;
  
          /**
           * @ORM\Column(type="decimal", scale=2)
           */
          protected $price;
  
          /**
           * @ORM\Column(type="text")
           */
          protected $description;
      }
  </code></pre>
  
  <p>3) Type <code>php app/console doctrine:generate:entities src/AppBundle/Entity:Product</code> - which produced the "unknown entity namespace" error message.</p>
  
  <p>Any help appreciated.</p>