title: Not a valid entity or mapped super class error from Doctrine
body: <p>I am trying to set up Doctrine (2.2.1) to use with my site and I followed the getting started guide and I am getting the following error:</p>
  
  <pre><code>Fatal error: Uncaught exception 'Doctrine\ORM\Mapping\MappingException' with message 'Class   DocumentField is not a valid entity or mapped super class.' in C:\inetpub\sites\hd\Doctrine\ORM\Mapping\MappingException.php:147 Stack trace: #0 C:\inetpub\sites\hd\Doctrine\ORM\Mapping\Driver\AnnotationDriver.php(165) {...}
  </code></pre>
  
  <p><code>DocumentField</code> is defined as follows (in root/Doctrine/entities/DocumentField.php:</p>
  
  <pre><code>&lt;?php
  /** @Entity **/
  /** @Table(name="DocumentFields") */
  class DocumentField
  {
      /** @Id @GeneratedValue @Column(type="integer") **/
      protected $id;
      /** @var @Column(type="string") **/
      protected $fieldName;
      /** @var @Column(type="integer") **/
      protected $fieldType;
      /** @var @Column(type="integer") **/
      protected $required;
  
      public function getId() {
          return $this-&gt;id;
      }
  
      public function getName() {
          return $this-&gt;fieldName;
      }
  
      public function setName($name) {
          $this-&gt;fieldName = $name;
      }
  
      public function getType() {
          return $this-&gt;fieldType;
      }
  
      public function setType($type) {
          $this-&gt;fieldType = $type;
      }
  
      public function getRequired() {
          return $this-&gt;required;
      }
  
      public function setRequired($value) {
          $this-&gt;required = $value;
      }
  }
  </code></pre>
  
  <p>?></p>
  
  <p>Doctrine is included like this in the page:</p>
  
  <pre><code>/* Load Doctorine ORM */
  require "$root/Doctrine/ORM/Tools/Setup.php";
  $lib = "$root/";
  Doctrine\ORM\Tools\Setup::registerAutoloadDirectory($lib);
  require "doctrine-configure.php";
  </code></pre>
  
  <p>The <code>doctrine-configure.php</code> file:
      
  
  <pre><code>//if ($applicationMode == "development") {
      $cache = new \Doctrine\Common\Cache\ArrayCache;
  //} else {
  //    $cache = new \Doctrine\Common\Cache\ApcCache;
  //}
  
  $config = new Configuration;
  $config-&gt;setMetadataCacheImpl($cache);
  $driverImpl = $config-&gt;newDefaultAnnotationDriver($GLOBALS["BASE_PATH"].'\\Doctrine\\entities');
  $config-&gt;setMetadataDriverImpl($driverImpl);
  $config-&gt;setQueryCacheImpl($cache);
  $config-&gt;setProxyDir($GLOBALS["BASE_PATH"].'\\Doctrine\\proxies');
  $config-&gt;setProxyNamespace('Helpdesk\Proxies');
  
  //if ($applicationMode == "development") {
      $config-&gt;setAutoGenerateProxyClasses(true);
  //} else {
  //    $config-&gt;setAutoGenerateProxyClasses(false);
  //}
  
  $connectionOptions = array(
      'driver' =&gt; 'pdo_sqlsrv',
      'user' =&gt; '{user}',
      'password' =&gt; '{pass}',
      'host' =&gt; 'sql1',
      'dbname' =&gt; 'HD'
  );
  
  $entityManager = EntityManager::create($connectionOptions, $config);
  </code></pre>
  
  <p>?></p>
  
  <p>And finally the code that causes the crash:</p>
  
  <pre><code>require "$root/Doctrine/entities/DocumentField.php";
  $field = new DocumentField();
  $field-&gt;setName("Hello World");
  $field-&gt;setType(1);
  $field-&gt;setRequired(1);
  $entityManager-&gt;persist($field);
  $entityManager-&gt;flush();
  </code></pre>