title: doctrine orm:schema-tool:create - Class Bug does not exist
body: <p>Hi this is my first time doing doctrin22 but i cant get it to work,</p>
  
  <p>here is my code</p>
  
  <p>index.php</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  if (getenv('APPLICATION_ENV')) {
      define('APPLICATION_ENV', getenv('APPLICATION_ENV'));
  } else {
      define('APPLICATION_ENV', 'production');
  }
  
  require_once 'Doctrine/Common/ClassLoader.php';
  
  $classLoader = new \Doctrine\Common\ClassLoader('Doctrine');
  $classLoader-&gt;register();
  
  $config = new Doctrine\ORM\Configuration(); // (2)
  
  // Proxy Configuration (3)
  $config-&gt;setProxyDir(__DIR__.'/lib/MyProject/Proxies');
  $config-&gt;setProxyNamespace('MyProject\Proxies');
  $config-&gt;setAutoGenerateProxyClasses((APPLICATION_ENV == "development"));
  
  // Mapping Configuration (4)
  $driverImpl = new Doctrine\ORM\Mapping\Driver\XmlDriver(__DIR__."/config/mappings/xml");
  $config-&gt;setMetadataDriverImpl($driverImpl);
  
  
  // Caching Configuration (5)
  if (APPLICATION_ENV == "development") {
      $cache = new \Doctrine\Common\Cache\ArrayCache();
  } else {
      $cache = new \Doctrine\Common\Cache\ApcCache();
  }
  $config-&gt;setMetadataCacheImpl($cache);
  $config-&gt;setQueryCacheImpl($cache);
  
  // database configuration parameters (6)
  $conn = array(
      'driver' =&gt; 'pdo_sqlite',
      'path' =&gt; __DIR__ . '/db.sqlite',
  );
  
  // obtaining the entity manager (7)
  $evm = new Doctrine\Common\EventManager();
  $entityManager = \Doctrine\ORM\EntityManager::create($conn, $config, $evm);
  ?&gt;
  </code></pre>
  
  <p>cli-config.php</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  require_once 'index.php';
  $helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
      'em' =&gt; new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($entityManager)
  ));
  ?&gt;
  </code></pre>
  
  <p>and my folder structure</p>
  
  <pre><code>myproject/index.php
  myproject/cli-config.php
  myproject/config/mappings/xml/Bug.dcm.xml
  myproject/config/mappings/xml/Product.dcm.xml
  myproject/config/mappings/xml/User.dcm.xml
  </code></pre>
  
  <p>when i run 
      myproject/doctrine orm:schema-tool:create --dump-sql</p>
  
  <p>i get the following</p>
  
  <pre><code>doctrine orm:schema-tool:create --dump-sql
  PHP Warning:  class_parents(): Class Bug does not exist and could not be loaded in /usr/local/zend/share/pear/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php on line 40
  PHP Stack trace:
  PHP   1. {main}() /usr/local/zend/bin/doctrine:0
  PHP   2. include() /usr/local/zend/bin/doctrine:4
  PHP   3. Doctrine\ORM\Tools\Console\ConsoleRunner::run() /usr/local/zend/bin/doctrine.php:50
  PHP   4. Symfony\Component\Console\Application-&gt;run() /usr/local/zend/share/pear/Doctrine/ORM/Tools/Console/ConsoleRunner.php:39
  PHP   5. Symfony\Component\Console\Application-&gt;doRun() /usr/local/zend/share/pear/Symfony/Component/Console/Application.php:118
  PHP   6. Symfony\Component\Console\Command\Command-&gt;run() /usr/local/zend/share/pear/Symfony/Component/Console/Application.php:194
  PHP   7. Doctrine\ORM\Tools\Console\Command\SchemaTool\AbstractCommand-&gt;execute() /usr/local/zend/share/pear/Symfony/Component/Console/Command/Command.php:224
  PHP   8. Doctrine\ORM\Mapping\ClassMetadataFactory-&gt;getAllMetadata() /usr/local/zend/share/pear/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php:53
  PHP   9. Doctrine\ORM\Mapping\ClassMetadataFactory-&gt;getMetadataFor() /usr/local/zend/share/pear/Doctrine/ORM/Mapping/ClassMetadataFactory.php:131
  PHP  10. Doctrine\ORM\Mapping\ClassMetadataFactory-&gt;loadMetadata() /usr/local/zend/share/pear/Doctrine/ORM/Mapping/ClassMetadataFactory.php:178
  PHP  11. Doctrine\ORM\Mapping\ClassMetadataFactory-&gt;getParentClasses() /usr/local/zend/share/pear/Doctrine/ORM/Mapping/ClassMetadataFactory.php:254
  PHP  12. Doctrine\Common\Persistence\Mapping\RuntimeReflectionService-&gt;getParentClasses() /usr/local/zend/share/pear/Doctrine/ORM/Mapping/ClassMetadataFactory.php:231
  PHP  13. class_parents() /usr/local/zend/share/pear/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php:40
  
  Warning: class_parents(): Class Bug does not exist and could not be loaded in /usr/local/zend/share/pear/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php on line 40
  
  Call Stack:
      0.0001     625400   1. {main}() /usr/local/zend/bin/doctrine:0
      0.0002     639440   2. include('/usr/local/zend/bin/doctrine.php') /usr/local/zend/bin/doctrine:4
      0.0086    4245576   3. Doctrine\ORM\Tools\Console\ConsoleRunner::run() /usr/local/zend/bin/doctrine.php:50
      0.0151    6311808   4. Symfony\Component\Console\Application-&gt;run() /usr/local/zend/share/pear/Doctrine/ORM/Tools/Console/ConsoleRunner.php:39
      0.0164    6761376   5. Symfony\Component\Console\Application-&gt;doRun() /usr/local/zend/share/pear/Symfony/Component/Console/Application.php:118
      0.0169    6761544   6. Symfony\Component\Console\Command\Command-&gt;run() /usr/local/zend/share/pear/Symfony/Component/Console/Application.php:194
      0.0171    6761920   7. Doctrine\ORM\Tools\Console\Command\SchemaTool\AbstractCommand-&gt;execute() /usr/local/zend/share/pear/Symfony/Component/Console/Command/Command.php:224
      0.0171    6761920   8. Doctrine\ORM\Mapping\ClassMetadataFactory-&gt;getAllMetadata() /usr/local/zend/share/pear/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php:53
      0.0172    6764016   9. Doctrine\ORM\Mapping\ClassMetadataFactory-&gt;getMetadataFor() /usr/local/zend/share/pear/Doctrine/ORM/Mapping/ClassMetadataFactory.php:131
      0.0172    6764064  10. Doctrine\ORM\Mapping\ClassMetadataFactory-&gt;loadMetadata() /usr/local/zend/share/pear/Doctrine/ORM/Mapping/ClassMetadataFactory.php:178
      0.0172    6764280  11. Doctrine\ORM\Mapping\ClassMetadataFactory-&gt;getParentClasses() /usr/local/zend/share/pear/Doctrine/ORM/Mapping/ClassMetadataFactory.php:254
      0.0173    6799712  12. Doctrine\Common\Persistence\Mapping\RuntimeReflectionService-&gt;getParentClasses() /usr/local/zend/share/pear/Doctrine/ORM/Mapping/ClassMetadataFactory.php:231
      0.0173    6799760  13. class_parents() /usr/local/zend/share/pear/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php:40
  
  PHP Warning:  array_reverse() expects parameter 1 to be array, boolean given in /usr/local/zend/share/pear/Doctrine/ORM/Mapping/ClassMetadataFactory.php on line 231
  PHP Stack trace:
  PHP   1. {main}() /usr/local/zend/bin/doctrine:0
  PHP   2. include() /usr/local/zend/bin/doctrine:4
  PHP   3. Doctrine\ORM\Tools\Console\ConsoleRunner::run() /usr/local/zend/bin/doctrine.php:50
  PHP   4. Symfony\Component\Console\Application-&gt;run() /usr/local/zend/share/pear/Doctrine/ORM/Tools/Console/ConsoleRunner.php:39
  PHP   5. Symfony\Component\Console\Application-&gt;doRun() /usr/local/zend/share/pear/Symfony/Component/Console/Application.php:118
  PHP   6. Symfony\Component\Console\Command\Command-&gt;run() /usr/local/zend/share/pear/Symfony/Component/Console/Application.php:194
  PHP   7. Doctrine\ORM\Tools\Console\Command\SchemaTool\AbstractCommand-&gt;execute() /usr/local/zend/share/pear/Symfony/Component/Console/Command/Command.php:224
  PHP   8. Doctrine\ORM\Mapping\ClassMetadataFactory-&gt;getAllMetadata() /usr/local/zend/share/pear/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php:53
  PHP   9. Doctrine\ORM\Mapping\ClassMetadataFactory-&gt;getMetadataFor() /usr/local/zend/share/pear/Doctrine/ORM/Mapping/ClassMetadataFactory.php:131
  PHP  10. Doctrine\ORM\Mapping\ClassMetadataFactory-&gt;loadMetadata() /usr/local/zend/share/pear/Doctrine/ORM/Mapping/ClassMetadataFactory.php:178
  PHP  11. Doctrine\ORM\Mapping\ClassMetadataFactory-&gt;getParentClasses() /usr/local/zend/share/pear/Doctrine/ORM/Mapping/ClassMetadataFactory.php:254
  PHP  12. array_reverse() /usr/local/zend/share/pear/Doctrine/ORM/Mapping/ClassMetadataFactory.php:231
  
  Warning: array_reverse() expects parameter 1 to be array, boolean given in /usr/local/zend/share/pear/Doctrine/ORM/Mapping/ClassMetadataFactory.php on line 231
  
  Call Stack:
      0.0001     625400   1. {main}() /usr/local/zend/bin/doctrine:0
      0.0002     639440   2. include('/usr/local/zend/bin/doctrine.php') /usr/local/zend/bin/doctrine:4
      0.0086    4245576   3. Doctrine\ORM\Tools\Console\ConsoleRunner::run() /usr/local/zend/bin/doctrine.php:50
      0.0151    6311808   4. Symfony\Component\Console\Application-&gt;run() /usr/local/zend/share/pear/Doctrine/ORM/Tools/Console/ConsoleRunner.php:39
      0.0164    6761376   5. Symfony\Component\Console\Application-&gt;doRun() /usr/local/zend/share/pear/Symfony/Component/Console/Application.php:118
      0.0169    6761544   6. Symfony\Component\Console\Command\Command-&gt;run() /usr/local/zend/share/pear/Symfony/Component/Console/Application.php:194
      0.0171    6761920   7. Doctrine\ORM\Tools\Console\Command\SchemaTool\AbstractCommand-&gt;execute() /usr/local/zend/share/pear/Symfony/Component/Console/Command/Command.php:224
      0.0171    6761920   8. Doctrine\ORM\Mapping\ClassMetadataFactory-&gt;getAllMetadata() /usr/local/zend/share/pear/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php:53
      0.0172    6764016   9. Doctrine\ORM\Mapping\ClassMetadataFactory-&gt;getMetadataFor() /usr/local/zend/share/pear/Doctrine/ORM/Mapping/ClassMetadataFactory.php:131
      0.0172    6764064  10. Doctrine\ORM\Mapping\ClassMetadataFactory-&gt;loadMetadata() /usr/local/zend/share/pear/Doctrine/ORM/Mapping/ClassMetadataFactory.php:178
      0.0172    6764280  11. Doctrine\ORM\Mapping\ClassMetadataFactory-&gt;getParentClasses() /usr/local/zend/share/pear/Doctrine/ORM/Mapping/ClassMetadataFactory.php:254
      0.0176    6799840  12. array_reverse() /usr/local/zend/share/pear/Doctrine/ORM/Mapping/ClassMetadataFactory.php:231
  
  PHP Warning:  Invalid argument supplied for foreach() in /usr/local/zend/share/pear/Doctrine/ORM/Mapping/ClassMetadataFactory.php on line 231
  PHP Stack trace:
  PHP   1. {main}() /usr/local/zend/bin/doctrine:0
  PHP   2. include() /usr/local/zend/bin/doctrine:4
  PHP   3. Doctrine\ORM\Tools\Console\ConsoleRunner::run() /usr/local/zend/bin/doctrine.php:50
  PHP   4. Symfony\Component\Console\Application-&gt;run() /usr/local/zend/share/pear/Doctrine/ORM/Tools/Console/ConsoleRunner.php:39
  PHP   5. Symfony\Component\Console\Application-&gt;doRun() /usr/local/zend/share/pear/Symfony/Component/Console/Application.php:118
  PHP   6. Symfony\Component\Console\Command\Command-&gt;run() /usr/local/zend/share/pear/Symfony/Component/Console/Application.php:194
  PHP   7. Doctrine\ORM\Tools\Console\Command\SchemaTool\AbstractCommand-&gt;execute() /usr/local/zend/share/pear/Symfony/Component/Console/Command/Command.php:224
  PHP   8. Doctrine\ORM\Mapping\ClassMetadataFactory-&gt;getAllMetadata() /usr/local/zend/share/pear/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php:53
  PHP   9. Doctrine\ORM\Mapping\ClassMetadataFactory-&gt;getMetadataFor() /usr/local/zend/share/pear/Doctrine/ORM/Mapping/ClassMetadataFactory.php:131
  PHP  10. Doctrine\ORM\Mapping\ClassMetadataFactory-&gt;loadMetadata() /usr/local/zend/share/pear/Doctrine/ORM/Mapping/ClassMetadataFactory.php:178
  PHP  11. Doctrine\ORM\Mapping\ClassMetadataFactory-&gt;getParentClasses() /usr/local/zend/share/pear/Doctrine/ORM/Mapping/ClassMetadataFactory.php:254
  
  Warning: Invalid argument supplied for foreach() in /usr/local/zend/share/pear/Doctrine/ORM/Mapping/ClassMetadataFactory.php on line 231
  
  Call Stack:
      0.0001     625400   1. {main}() /usr/local/zend/bin/doctrine:0
      0.0002     639440   2. include('/usr/local/zend/bin/doctrine.php') /usr/local/zend/bin/doctrine:4
      0.0086    4245576   3. Doctrine\ORM\Tools\Console\ConsoleRunner::run() /usr/local/zend/bin/doctrine.php:50
      0.0151    6311808   4. Symfony\Component\Console\Application-&gt;run() /usr/local/zend/share/pear/Doctrine/ORM/Tools/Console/ConsoleRunner.php:39
      0.0164    6761376   5. Symfony\Component\Console\Application-&gt;doRun() /usr/local/zend/share/pear/Symfony/Component/Console/Application.php:118
      0.0169    6761544   6. Symfony\Component\Console\Command\Command-&gt;run() /usr/local/zend/share/pear/Symfony/Component/Console/Application.php:194
      0.0171    6761920   7. Doctrine\ORM\Tools\Console\Command\SchemaTool\AbstractCommand-&gt;execute() /usr/local/zend/share/pear/Symfony/Component/Console/Command/Command.php:224
      0.0171    6761920   8. Doctrine\ORM\Mapping\ClassMetadataFactory-&gt;getAllMetadata() /usr/local/zend/share/pear/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php:53
      0.0172    6764016   9. Doctrine\ORM\Mapping\ClassMetadataFactory-&gt;getMetadataFor() /usr/local/zend/share/pear/Doctrine/ORM/Mapping/ClassMetadataFactory.php:131
      0.0172    6764064  10. Doctrine\ORM\Mapping\ClassMetadataFactory-&gt;loadMetadata() /usr/local/zend/share/pear/Doctrine/ORM/Mapping/ClassMetadataFactory.php:178
      0.0172    6764280  11. Doctrine\ORM\Mapping\ClassMetadataFactory-&gt;getParentClasses() /usr/local/zend/share/pear/Doctrine/ORM/Mapping/ClassMetadataFactory.php:254
  
  
  
  
  [ReflectionException]     
  Class Bug does not exist  
  
  
  
  orm:schema-tool:create [--dump-sql]
  </code></pre>