title: Unknown Entity namespace alias in symfony2
body: <p>Hey I have two bundles in my symfony2 project. one is Bundle and the other one is PatentBundle. </p>
  
  <p>My app/config/route.yml file is </p>
  
  <pre><code>MunichInnovationGroupPatentBundle:
  resource: "@MunichInnovationGroupPatentBundle/Controller/"
  type:     annotation
  prefix:   /
  defaults:  { _controller: "MunichInnovationGroupPatentBundle:Default:index" }
  
  MunichInnovationGroupBundle:
  resource: "@MunichInnovationGroupBundle/Controller/"
  type:     annotation
  prefix:   /v1
  defaults:  { _controller: "MunichInnovationGroupBundle:Patent:index" }
  
  login_check:
  pattern:   /login_check
  
  logout:
  pattern:   /logout
  </code></pre>
  
  <p>inside my controller i have </p>
  
  <pre><code>&lt;?php
  namespace MunichInnovationGroup\PatentBundle\Controller;
  
  use Symfony\Component\HttpFoundation\Response;
  use Symfony\Component\HttpFoundation\Request;
  use JMS\SecurityExtraPatentBundle\Annotation\Secure;
  use Symfony\Component\Security\Core\Exception\AccessDeniedException;
  use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
  use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
  use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  use Symfony\Component\Security\Core\SecurityContext;
  
  use MunichInnovationGroup\PatentBundle\Entity\Log;
  use MunichInnovationGroup\PatentBundle\Entity\UserPatent;
  use MunichInnovationGroup\PatentBundle\Entity\PmPortfolios;
  use MunichInnovationGroup\PatentBundle\Entity\UmUsers;
  use MunichInnovationGroup\PatentBundle\Entity\PmPatentgroups;
  use MunichInnovationGroup\PatentBundle\Form\PortfolioType;
  use MunichInnovationGroup\PatentBundle\Util\SecurityHelper;
  use Exception;
  /**
   * Portfolio controller.
   * @Route("/portfolio")
   */
  class PortfolioController extends Controller {
  /**
   * Index action.
   *
   * @Route("/", name="v2_pm_portfolio")
   * @Template("MunichInnovationGroupPatentBundle:Portfolio:index.html.twig")
   */
     public function indexAction(Request $request) {
      $portfolios = $this-&gt;getDoctrine()
      -&gt;getRepository('MunichInnovationGroupPatentBundle:PmPortfolios')
      -&gt;findBy(array('user' =&gt; '$user_id'));
  
             // rest of the method
    }
  </code></pre>
  
  <p><strong>Edit:</strong> </p>
  
  <p>My Entity Class</p>
  
  <pre><code>&lt;?php
  
   namespace MunichInnovationGroup\PatentBundle\Entity;
  
   use Doctrine\ORM\Mapping as ORM;
  
    /**
    * MunichInnovationGroup\PatentBundle\Entity\PmPortfolios
    *
    * @ORM\Table(name="pm_portfolios")
    * @ORM\Entity
    */
    class PmPortfolios
    {
  /**
   * @var string $id
   *
   * @ORM\Column(name="id", type="string", length=36, nullable=false)
   * @ORM\Id
   * @ORM\GeneratedValue(strategy="UUID")
   */
  private $id;
  
  /**
   * @var string $portfolioName
   *
   * @ORM\Column(name="portfolio_name", type="string", length=255, nullable=false)
   */
  private $portfolioName;
  
  /**
   * @var text $description
   *
   * @ORM\Column(name="description", type="text", nullable=true)
   */
  private $description;
  
  /**
   * @var string $permalink
   *
   * @ORM\Column(name="permalink", type="string", length=255, nullable=false)
   */
  private $permalink;
  
  /**
   * @var string $sharingCode
   *
   * @ORM\Column(name="sharing_code", type="string", length=255, nullable=false)
   */
  private $sharingCode;
  
  /**
   * @var boolean $shared
   *
   * @ORM\Column(name="shared", type="boolean", nullable=false)
   */
  private $shared;
  
  /**
   * @var integer $sharedPortfolioCalls
   *
   * @ORM\Column(name="shared_portfolio_calls", type="integer", nullable=true)
   */
  private $sharedPortfolioCalls;
  
  /**
   * @var boolean $isDefault
   *
   * @ORM\Column(name="is_default", type="boolean", nullable=false)
   */
  private $isDefault;
  
  /**
   * @var UmUsers
   *
   * @ORM\ManyToOne(targetEntity="UmUsers")
   * @ORM\JoinColumns({
   *   @ORM\JoinColumn(name="user_id", referencedColumnName="id")
   * })
   */
  private $user;
  
  
  
  /**
   * Get id
   *
   * @return string 
   */
  public function getId()
  {
      return $this-&gt;id;
  }
  
  /**
   * Set portfolioName
   *
   * @param string $portfolioName
   */
  public function setPortfolioName($portfolioName)
  {
      $this-&gt;portfolioName = $portfolioName;
  }
  
  /**
   * Get portfolioName
   *
   * @return string 
   */
  public function getPortfolioName()
  {
      return $this-&gt;portfolioName;
  }
  
  /**
   * Set description
   *
   * @param text $description
   */
  public function setDescription($description)
  {
      $this-&gt;description = $description;
  }
  
  /**
   * Get description
   *
   * @return text 
   */
  public function getDescription()
  {
      return $this-&gt;description;
  }
  
  /**
   * Set permalink
   *
   * @param string $permalink
   */
  public function setPermalink($permalink)
  {
      $this-&gt;permalink = $permalink;
  }
  
  /**
   * Get permalink
   *
   * @return string 
   */
  public function getPermalink()
  {
      return $this-&gt;permalink;
  }
  
  /**
   * Set sharingCode
   *
   * @param string $sharingCode
   */
  public function setSharingCode($sharingCode)
  {
      $this-&gt;sharingCode = $sharingCode;
  }
  
  /**
   * Get sharingCode
   *
   * @return string 
   */
  public function getSharingCode()
  {
      return $this-&gt;sharingCode;
  }
  
  /**
   * Set shared
   *
   * @param boolean $shared
   */
  public function setShared($shared)
  {
      $this-&gt;shared = $shared;
  }
  
  /**
   * Get shared
   *
   * @return boolean 
   */
  public function getShared()
  {
      return $this-&gt;shared;
  }
  
  /**
   * Set sharedPortfolioCalls
   *
   * @param integer $sharedPortfolioCalls
   */
  public function setSharedPortfolioCalls($sharedPortfolioCalls)
  {
      $this-&gt;sharedPortfolioCalls = $sharedPortfolioCalls;
  }
  
  /**
   * Get sharedPortfolioCalls
   *
   * @return integer 
   */
  public function getSharedPortfolioCalls()
  {
      return $this-&gt;sharedPortfolioCalls;
  }
  
  /**
   * Set isDefault
   *
   * @param boolean $isDefault
   */
  public function setIsDefault($isDefault)
  {
      $this-&gt;isDefault = $isDefault;
  }
  
  /**
   * Get isDefault
   *
   * @return boolean 
   */
  public function getIsDefault()
  {
      return $this-&gt;isDefault;
  }
  
  /**
   * Set user
   *
   * @param MunichInnovationGroup\PatentBundle\Entity\UmUsers $user
   */
  public function setUser(\MunichInnovationGroup\PatentBundle\Entity\UmUsers $user)
  {
      $this-&gt;user = $user;
  }
  
  /**
   * Get user
   *
   * @return MunichInnovationGroup\PatentBundle\Entity\UmUsers 
   */
  public function getUser()
  {
      return $this-&gt;user;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>My bundle main class: MunichInnovationGroupPatentBundle.php</p>
  
  <pre><code> &lt;?php
  
    namespace MunichInnovationGroup\PatentBundle;
  
    use Symfony\Component\HttpKernel\Bundle\Bundle;
  
    class MunichInnovationGroupPatentBundle extends Bundle
   {
   }
  </code></pre>
  
  <p>when i try to load localhost/web/app_dev.php/portfolio</p>
  
  <p>It says</p>
  
  <pre><code>   Unknown Entity namespace alias 'MunichInnovationGroupPatentBundle'.
  </code></pre>
  
  <p>I am unable to figure out this error 
  please help me if anyone has any idea I googled it a lot :(</p>
  
  <p>Thanks in advance
         500 Internal Server Error - ORMException</p>