title: Attempted to load class Error Symfony 2
body: <p>My problem is, I am trying to execute a command, but give me the next error:</p>
  
  <blockquote>
    <p>Attempted to load class "XMLReport" from namespace
    "BusinessName\Core\LibraryDatabaseBundle\Repository".     Did you
    forget a "use" statement for
    "BusinessName\Core\LibraryDatabaseBundle\Entity\XMLReport"?</p>
  </blockquote>
  
  <p>The repository class is using the namespace:</p>
  
  <pre><code>namespace Mundoreader\Core\LibraryDatabaseBundle\Repository;
  
  use Doctrine\ORM\Query\QueryException;
  use Doctrine\ORM\Query\ResultSetMapping;
  use Doctrine\ORM\QueryBuilder;
  use Mundoreader\Core\LibraryDatabaseBundle\Entity\Library;
  
  /**
   * Class XMLReportRepository
   *
   */
  class XMLReportRepository extends AbstractRepository
  {/*code
  }
  </code></pre>
  
  <p>The command class is:</p>
  
  <pre><code>class GenerateXMLCommand extends AbstractCommand
  {
  
      protected function configure()
      {
          $this
              -&gt;setName('library:reports:generateXML')
              -&gt;setDescription('Generate XML');
      }    
  protected function execute(InputInterface $input, OutputInterface $output)
          {
              $statusToDo         = $this-&gt;xmlReportRepo-&gt;countAllStatusToDo();
  
              if($statusToDo)
              {
  
                  //XML BBDD
                  $emXML          = new XMLReport();
                  $libraryXML     = $emXML-&gt;getLibrary();
                  $isbnXML        = $emXML-&gt;getISBN();
                  $toDateXML      = $emXML-&gt;getReportDateEnd();
                  $fromDateXML    = $emXML-&gt;getReportDateStart();
                  $arrayXMLInfo = array(
                      ['fromDate']    =&gt; $fromDateXML,
                      ['toDate']      =&gt; $toDateXML,
                      ['library']     =&gt; $libraryXML,
                      ['isbn']        =&gt; $isbnXML
                  );
      /*More Code 
      }
  </code></pre>
  
  <p>I dont know where is the error, because I call repository in:</p>
  
  <pre><code>$statusToDo         = $this-&gt;xmlReportRepo-&gt;countAllStatusToDo();
  </code></pre>
  
  <p>In the extend class I have the route:</p>
  
  <pre><code>abstract class AbstractCommand extends ContainerAwareCommand
  {
  public function setContainer(ContainerInterface $container = null)
      {
          $this-&gt;xmlReportRepo = $this-&gt;doctrine-&gt;getRepository('MrLibraryDatabaseBundle:XMLReport');
      }
  }
  </code></pre>
  
  <p>PD: Sorry for my bad english.</p>