title: How to fix class is not a valid entity or mapped super class?
body: <p>So I'm trying to follow <a href="http://symfony.com/doc/current/book/doctrine.html" rel="nofollow noreferrer">symfony2's tutorial on doctrine</a> for my own website  and modeling my <code>User</code> entity after their <code>Product</code> one.</p>
  
  <p>Also, before anyone marks this a duplicate, I have already tried the solutions given in numerous other questions with no luck:  </p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/14662535/not-a-valid-entity-or-mapped-super-class">Not a valid entity or mapped super class</a></li>
  <li><a href="https://stackoverflow.com/questions/19144603/doctrine-class-is-not-a-valid-entity-or-mapped-super-class">Doctrine class is not a valid entity or mapped super class</a></li>
  <li><a href="https://stackoverflow.com/questions/17765591/symfony-doctrine-class-is-not-a-valid-entity-or-mapped-super-class">Symfony/Doctrine: Class is not a valid entity or mapped super class</a></li>
  <li><a href="https://stackoverflow.com/questions/14986080/symfony2-is-not-a-valid-entity-or-mapped-super-class">symfony2 is not a valid entity or mapped super class</a></li>
  <li><a href="https://stackoverflow.com/questions/17765591/symfony-doctrine-class-is-not-a-valid-entity-or-mapped-super-class">Symfony/Doctrine: Class is not a valid entity or mapped super class</a></li>
  <li><a href="https://stackoverflow.com/questions/7820597/class-xxx-is-not-a-valid-entity-or-mapped-super-class-after-moving-the-class-i">&quot;Class XXX is not a valid entity or mapped super class&quot; after moving the class in the filesystem</a></li>
  </ul>
  
  <p>and the list goes on</p>
  
  <p>I have my entity class:</p>
  
  <pre><code>&lt;?php
      namespace MySite\MyBundle\Entity;
  
      use Doctrine\ORM\Mapping as ORM;
  
      /**
       * @ORM\Entity
       * @ORM\Table(name="user")
       */
      class User
      {
          /**
           * @ORM\Column(type="integer")
           * @ORM\Id
           * @ORM\GeneratedValue(strategy="AUTO")
           */
          protected $id;
  
          /**
           * @ORM\Column(type="string", length=100)
           */
          protected $name;
  
          /**
           * @ORM\Column(type="string", length=64)
           */
          protected $password;
      }
  ?&gt;
  </code></pre>
  
  <p>Now, I'm running the command:</p>
  
  <pre><code>$ php app/console doctrine:generate:entities MySite/MyBundle/Entity/User
  </code></pre>
  
  <p>to generate the accessor methods. However, when I do this, I get the error:</p>
  
  <pre><code>[Doctrine\ORM\Mapping\MappingException]
  Class "MySite\MyBundle\Entity\User" is not a valid entity or mapped super class.
  </code></pre>